You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is now a TS error because the theme prop is typed as a list of specific strings, but sadly is not exported anywhere that I can find. Here is the only place I've found it defined in your source:
Exact same problem for the id prop of TableBatchActions.defaultProps.translateWithId(), although I can find no existence of the allowed strings anywhere in the @carbon source folder. So now we have this defined locally as well:
Package
@carbon/react
Browser
No response
Package version
1.40
React version
17
Description
Here's a piece of my own code:
This is now a TS error because the
theme
prop is typed as a list of specific strings, but sadly is not exported anywhere that I can find. Here is the only place I've found it defined in your source:To workaround this, end users have to make their own type definition by copy/pasting the string values, like this:
export type CarbonThemeType = "white" | "g10" | "g90" | "g100";
And then to get rid of the error:
const [userTheme, setUserTheme] = useState<CarbonThemeType>("white");
Reproduction/example
see description
Steps to reproduce
see description
Suggested Severity
Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.
Application/PAL
CDD Hub
Code of Conduct
The text was updated successfully, but these errors were encountered: