Expected behavior:
Given the following snippet:
const useStyles = createUseStyles((theme) => ({
SectionTitle: {
color: theme.color, // Commenting out this line fixes the bug
// Bullet
"&:before": {
content: (props: JssProps) => `"${props.number}"`,
border: [1, "solid", "black"]
}
}
}));
The type should be:
const useStyles: (data?: JssProps & {
theme?: Jss.Theme;
}) => Record<"SectionTitle", string>
But instead, it's:
const useStyles: (data?: {
theme?: Jss.Theme;
}) => Record<"SectionTitle", string>
Describe the bug:
This only occurs in a very specific case:
- We use the theme in the JSS
- The Theme is not correctly defined (any)
My theme is actually generated by a webpack plugin, that's why the type not precise.
Reproduction:
https://codesandbox.io/s/bug-type-jss-j5gkw
Versions (please complete the following information):
- jss: 10.6.0
- Browser [e.g. chrome, safari]: Chrome / FireFox
- OS [e.g. Windows, macOS]: Linux
Expected behavior:
Given the following snippet:
The type should be:
But instead, it's:
Describe the bug:
This only occurs in a very specific case:
My theme is actually generated by a webpack plugin, that's why the type not precise.
Reproduction:
https://codesandbox.io/s/bug-type-jss-j5gkw
Versions (please complete the following information):