score:9
This is apparently an issue which was introduced in the 15.0.5 React type definitions. If you change to 15.0.4, everything should be fine.
See this issue: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/14284
score:41
If you have JSX inside your component or component test file must have .tsx
as your file extension. My code was not compiling as I had the .ts file extension. The moment I renamed it to .tsx
/jsx
it started working nicely!
Please also note that I was using Typescript, so that's why I renamed it to .tsx
. In case you are using ES6 rename it to .jsx
.
Source: stackoverflow.com
Related Query
- React Typescript - Argument of type is not assignable to parameter of type
- Argument of type 'HTMLElement | null' is not assignable to parameter of type 'Element'. Type 'null' is not assignable to type 'Element'.ts(2345)
- Argument of type 'unknown' is not assignable to parameter of type '{}'
- Argument of type 'Element' is not assignable to parameter of type 'ReactElement<any>
- react usestate hooks error: argument of type 'yyy' is not assignable to parameter of type 'setstateaction<xx>'
- getting error : Argument of type '() => () => boolean' is not assignable to parameter of type 'EffectCallback'
- Typescript React/Redux : Argument of type 'typeof MyClass' is not assignable to parameter of type 'ComponentType<...'
- React with Typescript: Argument of type 'never[]' is not assignable to parameter of type 'StateProperties | (() => StateProperties)'
- Argument of type '"MY_EVENTS_LOAD"' is not assignable to parameter of type 'TakeableChannel<unknown>' in yeild takeLatest
- React TypeScript: Argument is not assignable to parameter of type 'never'
- Argument of type 'string' is not assignable to parameter of type '`${string}` | `${string}.${string}` | `${string}.${number}`'
- Argument of type '(dispatch: Dispatch) => void' is not assignable to parameter of type 'AnyAction'
- Argument of type partial is not assignable to parameter of type
- Argument of type 'Date | null' is not assignable to parameter of type 'SetStateAction<Date>'
- React Typescript: Argument of type '{ [x: number]: any; }' is not assignable to parameter of type
- Argument of type 'number' is not assignable to parameter of type 'never' in array.includes()
- Argument of type 'string | null' is not assignable to parameter of type 'ValueFn<SVGPathElement, Datum[], string | number | boolean | null>'
- Argument of type '() => () => Promise<void>' is not assignable to parameter of type 'EffectCallback'
- Getting an error Argument of type 'unknown' is not assignable to parameter of type 'Error | null'
- Redux Toolkit - Argument of type 'AsyncThunkAction<>' is not assignable to parameter of type 'AnyAction'
- React js Typescript Argument of type 'string' is not assignable to parameter of type 'SetStateAction<number>'
- Argument of type 'Element[]' is not assignable to parameter of type 'Element'
- Redux - createStore. Argument of type is not assignable to parameter of type 'DeepPartial<any>'
- Argument of type 'AsyncThunkAction<any, void, {}>' is not assignable to parameter of type 'AnyAction'
- TS2345: Argument of type 'ReactNode' is not assignable to parameter of type 'ReactElement'
- Argument of type 'string | undefined' is not assignable to parameter of type 'string'. Type 'undefined' is not assignable to type 'string'
- Argument of type 'typeof test' is not assignable to parameter of type 'Component<{ children?: ReactNode; } & DispatchProp<any>>'
- React onclick Argument of type 'EventTarget' is not assignable to parameter of type 'Node'
- TypeScript w/ React - Argument of type 'string' is not assignable to parameter of type 'keyof T'
- Argument of type 'Function' is not assignable to parameter of type 'ComponentType<never>'
More Query from same tag
- Storybook 6 - how to set array of objects?
- Fit height or width of an image in a div, the smaller one
- Passing props to generic children
- Issues upgrading async componentDidMount() to async useEffect()
- How to use curl commands with ReactJS
- Number with decimal input in React?
- Antd Tree, : how to Disable checking child by default
- mapStateToProps causes strange warning in top most element?
- React/Next.js recommended way to set constants such as backend API URLs
- React function returns the last item in the JSON instead of mapping all of them
- How to get late binding in Typescript
- How can I display an image overlay on all other images that are not currently being hovered over?
- TS - Map id to object property
- Using the factory pattern with React
- How to know the direction a user is scrolling to in React.js?
- If statement in react .map function
- Custom word translator in React
- Update View After Sort Method Runs on Button Click
- How to extend input component functionality
- Where to store JWT token in react / client side in secure way?
- How to display a loading screen until all the useEffect, and fetches are done?
- How to properly display all the sub values for JSON records using React.js
- Express session always creating new session when making get/post request from react js
- creating a list with react-dropzone
- Not counting DOM elements in React site with Cypress?
- Change Semantic UI's Pagination icon
- How to correctly test React with act
- React component missing elements of props
- React 16.3 Context: expected a string (for built-in components) or a class/function (for composite components) but got: object
- Getting NULL / empty data when running fetch(URL) with useEffect() in React client