-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ThemeProp should not be optional #42
Comments
Anything on this? |
When using a function, I'm not sure there is a way to figure out automatically what is the type of Ideally the type should be inferred when providing it as a generic type. const myTheme = {
color: {
backgroundColor: '#123'
}
}
const SomeText = styled("div")<{ theme: typeof myTheme }>``; PS : Please do not provide only screenshots when opening an issue 🙏🏽 |
The screenshot in this instance provided enough information. `const SomeText = styled("div")<{ theme: typeof myTheme }>`` Defining the theme like this is wrong. For each no styled component I will have to define the theme as typeof myTheme. The documentation solid-styled-components is based of: https://styled-components.com/docs/advanced The theme is always defined by default, we simply extend onto it by giving it more props. |
The ThemeProp needs to be changed from optional to required if the ThemeProvider has theme as required.
This is causing props to be either DefaultTheme | undefined, when a theme is clearly defined.
The text was updated successfully, but these errors were encountered: