-
Notifications
You must be signed in to change notification settings - Fork 30.6k
[@types/styled-components] React Native Project error on tsc (Type 'C' and exported member 'NonReactStatics') #46855
Copy link
Copy link
Closed
Description
- I tried using the `@types/styled-components package and had problems.
- I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
- I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
- Mention the authors (see
Definitions by:inindex.d.ts) so they can respond.- Authors: @mgoszcz2 and @danilofuchs
the Error is this when i run tsc on React Native Project
compile normal the app runs great but with tsc get this errors
tested with the last version of typescript , and styled-compnents, i tried other versions but have the same error.
node_modules/@types/styled-components/ts3.7/index.d.ts:151:69 - error TS2694: Namespace '"C:/Users/bruno/desktop/authAppProject/AuthApp/node_modules/hoist-non-react-statics/index"' has no exported member 'NonReactStatics'.
151 string & StyledComponentBase<C, T, O, A> & hoistNonReactStatics.NonReactStatics<C extends React.ComponentType<any> ? C : never>;
~~~~~~~~~~~~~~~
node_modules/@types/styled-components/ts3.7/index.d.ts:170:39 - error TS2344: Type 'WithC' does not satisfy the constraint 'ComponentType<any>'.
Type 'unknown' is not assignable to type 'ComponentType<any>'.
Type 'unknown' is not assignable to type 'FunctionComponent<any>'.
Type 'WithC' is not assignable to type 'FunctionComponent<any>'.
Type 'unknown' is not assignable to type 'FunctionComponent<any>'.
170 StyledComponentInnerComponent<WithC>,
~~~~~
node_modules/@types/styled-components/ts3.7/index.d.ts:253:65 - error TS2344: Type 'C' does not satisfy the constraint 'ComponentType<any>'.
Type 'ElementType<any>' is not assignable to type 'ComponentType<any>'.
Type '"symbol"' is not assignable to type 'ComponentType<any>'.
Type 'C' is not assignable to type 'FunctionComponent<any>'.
Type 'ElementType<any>' is not assignable to type 'FunctionComponent<any>'.
Type '"symbol"' is not assignable to type 'FunctionComponent<any>'.
253 ? React.ComponentPropsWithRef<StyledComponentInnerComponent<C>>
~
node_modules/@types/styled-components/ts3.7/index.d.ts:266:39 - error TS2344: Type 'C' does not satisfy the constraint 'ComponentType<any>'.
Type 'unknown' is not assignable to type 'ComponentType<any>'.
Type 'unknown' is not assignable to type 'FunctionComponent<any>'.
Type 'C' is not assignable to type 'FunctionComponent<any>'.
Type 'unknown' is not assignable to type 'FunctionComponent<any>'.
266 StyledComponentInnerComponent<C>,
~
node_modules/@types/styled-components/ts3.7/native.d.ts:40:39 - error TS2344: Type 'C' does not satisfy the constraint 'ComponentType<any>'.
Type 'unknown' is not assignable to type 'ComponentType<any>'.
Type 'unknown' is not assignable to type 'FunctionComponent<any>'.
Type 'C' is not assignable to type 'FunctionComponent<any>'.
Type 'unknown' is not assignable to type 'FunctionComponent<any>'.
40 StyledComponentInnerComponent<C>,
~
Found 6 errors.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels