Skip to content

Add a helper to quickly provide a theme context w/o the ThemeProvider HOC #61

Closed
@kitten

Description

@kitten

There have been a lot of workaround and a lot of confused users around how to test theming.

styled-components/styled-components#624

The general problem is that wrapping a StyledComponent element in the ThemeProvider is not acceptable as it won't allow access to all enzyme methods for example.

Thus it's desirable to write a quick helper that creates a theme context or sth similar. Maybe it should also just be solved using some documentation.

For better or for worse, I'm going to lock the issue on the SC repo and continue a discussion for a solution here, since this can be solved using a simple helper and some text, instead of a huge, elongated issue on the styled-components repo, where people don't immediately spot the right workaround.

cc @MicheleBertoli (sorry 😆 let's see if this goes well)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions