score:3
as a kind of brute force method i satisfied the typescript compiler using a custom typings file.
// typings/custom.d.ts
declare module "*";
and tell the compiler in my tsconfig.json to read my custom typings:
// tsconfig.json
{
"compileroptions": {
"module": "commonjs",
"target": "es5",
"noimplicitany": false,
"removecomments": true,
"sourcemap": true,
"allowjs": true,
"watch": true,
"outdir": "./dist/",
"jsx": "react",
"experimentaldecorators": true,
"allowsyntheticdefaultimports": true,
"typeroots": [
"./typings",
"node_modules/@types"
]
}
}
Source: stackoverflow.com
Related Query
- Using JS React component in TypeScript: JSX element type 'MyComponent' is not a constructor function for JSX elements
- react: using es6 component in ts component: ts2605: jsx element type 'yyy' is not a constructor function for jsx elements
- React component in TypeScript if passed as parameter and assigned to variable; TS2604: JSX element type does not have any construct or call signatures
- Component cannot be used as a JSX component. Its return type 'Element[]' is not a valid JSX element
- React - cannot be used as a JSX component. Its return type 'void' is not a valid JSX element
- How to add type FunctionComponent to React functional component using the "function" syntax and not "const"?
- How to fix the type error Type '(string | Element) [] is not assignable to type 'string | Element | undefined' using react and typescript?
- React Dumb component Typescript error: Element is not a constructor function for JSX elements, property 'render' is missing
- TypeScript error: JSX element type 'Tree' does not have any construct or call signatures. I'm not able to import my own component
- Element type is invalid: expected a string, using JSX to define a component
- Ionic React JSX element type 'false | Element' is not a constructor function for JSX elements. Type 'false
- cannot be used as a JSX component Its return type string | Element is not a valid JSX element Type 'string' is not assignable to type 'Element | null'
- Component cannot be used as a JSX component. Its return type 'Element | undefined' is not a valid JSX element
- React component is not accepting JSX Element as prop
- How to display an unordered list into a JSX <ul> element in a React Form using class component
- error TS2602: JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist
- How do I get an attribute of an element nested in a React component using Jest and/or Enzyme?
- JSX Element type 'void' is not a constructor function for JSX elements
- Why do I have to .bind(this) for methods defined in React component class, but not in regular ES6 class
- TypeScript 3: JSX element type 'Component' does not have any construct or call signatures. [2604]
- Type error: JSX element type '{} | null | undefined' is not a constructor function for JSX elements
- React ES6 component inheritance: working, but not recommended?
- JSX element type does not have any construct or call signatures
- JSX element type 'Element[]' is not a constructor function for JSX elements?
- componentDidMount method not triggered when using inherited ES6 react class
- Using typescript in react,stateless component not assignable to type 'React.SFC'
- JSX element type 'App' is not a constructor function for JSX elements. Types of property 'setState' are incompatible
- fetch method is not defined using ES6 fetch in React
- TypeScript: JSX element type does not have any construct or call signatures
- State using React Typescript: Property does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes
More Query from same tag
- Force a child component to update when the parent state changes
- Facebook React.js :: Pass data for Client Side rendering
- Give new item when button clicked
- Dispatch a Redux action from a modal in React
- How to push new value to array state in react
- Using the React Children code example is not working
- Accessing Dynamically loaded JavaScript function
- double click in submit button to make a function work
- how to make custom radiobutton like this in reactjs
- Webpack url-loader or file-loader not working react app
- How to call debounce method within one function?
- How do I get the base64 string in the base64 object?
- Full Screen Component ReactJS
- Mui datepicker returns inverted day and month
- Why official doc recommend to use componentDidMount instead of callback in setState?
- New object is being added every time I type a letter
- Airbnb JS StyleGuide & history.push don't combine
- clientWidth function in React
- Is there a more succinct way to to write this reducer function that changes an item in an array?
- Cannot require a React.js component
- How to create new array of objects with globally replaced key value from a source array of objects
- React-Final-Form delays in taking input with render props in Field
- React - how to map nested object values?
- When I update the state variable of child component ,why it cause infinite loop?
- Adding Redux to an existing React app
- textContent error in react app when i use animejs for letter animation
- I get object instead of array after setting an attribute with setAttributes in React (WordPress Block Editor). What's wrong with my code?
- Reset file upload after useState react js hooks
- Best way to resolve react-hooks/exhaustive-deps warning
- TypeError: allentry.map is not a function