JSX element class does not support attributes because it does not have a 'props' property
See original GitHub issueš Bug Report
I am getting an error from typescript compiler on every component imported from this library:
JSX element class does not support attributes because it does not have a 'props' property
To be honest I am not really sure it is not due to the monorepo structure or the tsconfig setup but it is the first time I see this kind of error.
The weird thing is, it still compiles while my vscode screen is all red of errorsā¦
I hope someone here has seen this error or knows how to fix it.
To Reproduce
Steps to reproduce the behavior: I am on a somewhat fresh install of react-native inside a monorepo (lerna+yarn workspace). The following snippet gives an error for IconRegistry and ApplicationProvider components.
function App () {
return (
<Provider store={store}>
<IconRegistry icons={[EvaIconsPack, AntIconsPack, FeatherIconsPack, IoniconIconsPack, SimpleLineIconsPack]} />
<ApplicationProvider
{...eva}
theme={{...eva.dark, ...theme}}
customMapping={mapping}
>
<Router />
</ApplicationProvider>
</Provider>
)
}
Expected behavior
I shouldnāt get an error from the compiler.
UI Kitten and Eva version
| Package | Version |
|---|---|
| @eva-design/eva | ^2.1.1 |
| @ui-kitten/components | ^5.1.1 |
Environment information
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:9 (2 by maintainers)
Top Results From Across the Web
JSX element class does not support attributes because it does ...
I get this error when using "Cropper"Ā ...
Read more >Error "JSX element class does not support attributes because ...
Forum Thread - Error "JSX element class does not support attributes because it does not have a 'props' property" when following the tutorialĀ ......
Read more >HTML : JSX element class does not support attributes ...
HTML : JSX element class does not support attributes because it does not have a ' props ' property.ts. 889 views 10 months...
Read more >jsx element class does not support attributes ... - You.com
jsx element class does not support attributes because it does not have a 'props' property. Clear input field icon. Search query.
Read more >JSX element class does not support attributes because it does ...
Coding example for the question JSX element class does not support attributes because it does not have a 'props' property.ts(2607)-Reactjs.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This issue appears because @types/react-native does have an peer dependency to @types/react of *. Hence two different versions are installed (you can find out by running
yarn list @types/react). As far as I understand this should be covered by yarn deduplicate, I donāt know why that is not the case. But you can fix this by specifing the specific version that should be defined by using resolutions in package.jsonI just added the following section to package.json and it works now. After that you have to delete node_modules and run yarn install again
"resolutions": { "@types/react": "~17.0.21" },See this link for more info about resolutions in yarn
any help here pls?
JSX element class does not support attributes because it does not have a āpropsā property.ts(2607)