gregnb / gregnb/mui-datatables
React 18 error - cannot be used as a JSX component
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 906
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm using mui-datatables version 4.0.0 and after I updated my react version to 18.1.0.
I'm getting the error:
`TS2786: 'MUIDataTable' cannot be used as a JSX component.
Its element type 'ReactElement | Component | null' is not a valid JSX element.
Type 'Component' is not assignable to type 'Element | ElementClass | null'.
Type 'Component' is not assignable to type 'ElementClass'.`
the code for import the table:
`import MUIDataTable, { MUIDataTableColumn } from "mui-datatables"`
Thanks.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the reported JSX error with mui-datatables 4.0.0, React 18.1.0, and the shown import. Trace the package's published component typings and React/TypeScript compatibility; done means MUIDataTable can be used as a JSX component without TS2786.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100