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
I believe I've followed the docs in how to get theming to work with TypeScript, but it doesn't seem to work.
I've added both @emotion/react and @emotion/styled, defined what Theme should be in a types.d.ts file, and VsCode/Webstorm still do not recognize the return value of useTheme() or the theme in styled('div') $(props => props.theme...).... ;` as the theme I provided.
Check the useTheme() and styled('div') uses in App.tsx and see that the type of the theme is not recognized to be the same as what I defined in types.d.ts
Expected behavior:
Theme should be recognized as {hey: string}
Video demo:
2025-11-11.17-45-06.mp4
Environment information:
react version: 19.2.0 (but this happens in React 18 as well)
@emotion/react version: 11.14.0
@emotion/styled version: 11.14.1 (but this happens with version 11.14.0 too)
Current behavior:
I believe I've followed the docs in how to get theming to work with TypeScript, but it doesn't seem to work.
I've added both @emotion/react and @emotion/styled, defined what Theme should be in a types.d.ts file, and VsCode/Webstorm still do not recognize the return value of
useTheme()or the theme instyled('div')$(props => props.theme...).... ;` as the theme I provided.To reproduce:
npm installuseTheme()andstyled('div')uses inApp.tsxand see that the type of the theme is not recognized to be the same as what I defined in types.d.tsExpected behavior:
Theme should be recognized as
{hey: string}Video demo:
2025-11-11.17-45-06.mp4
Environment information:
reactversion: 19.2.0 (but this happens in React 18 as well)@emotion/reactversion: 11.14.0@emotion/styledversion: 11.14.1 (but this happens with version 11.14.0 too)