TS2352: Type 'typeof "/Users/xxxx/xxxxx/React/TypeScriptWithReact/node_modules/styled-components/t...' cannot be converted to type 'ThemedStyledComponentsModule<ThemeInterface>'.
Types of property 'ThemeProvider' are incompatible.
Type 'ComponentClass<ThemeProviderProps<object>>' is not comparable to type 'ComponentClass<ThemeProviderProps<ThemeInterface>>'.
Type 'ThemeProviderProps<object>' is not comparable to type 'ThemeProviderProps<ThemeInterface>'.
Type 'object' is not comparable to type 'ThemeInterface'.
Property 'primaryColor' is missing in type '{}'.
Also, I'd like to know if I need to import styled from this file styled-components.ts or do I need to still import styled from 'styled-components' from node-modules?
Hi,
I'm trying to get styled-components to work with TypeScript but I'm facing some issues. I've followed this example here: https://www.styled-components.com/docs/api#typescript
In this code:
Typescript is throwing the following error:
My theme.ts file looks like this:
Also, I'd like to know if I need to import styled from this file styled-components.ts or do I need to still import styled from 'styled-components' from node-modules?
Any help would be appreciated. Thank you