Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'SelectCellFormatter' cannot be used as a JSX component. #3424

Open
leinjay opened this issue Jan 14, 2024 · 5 comments
Open

'SelectCellFormatter' cannot be used as a JSX component. #3424

leinjay opened this issue Jan 14, 2024 · 5 comments
Labels

Comments

@leinjay
Copy link

leinjay commented Jan 14, 2024

when i copy "website/demos/CommonFeatures.tsx" to my react project , it can not run , could you tell me the reason , thank you
截屏2024-01-14 19 49 40
maybe the function "useDefaultRenderers()" return "undefined"

@leinjay leinjay added the Bug label Jan 14, 2024
@nstepien
Copy link
Contributor

Sounds like you need to update the @types/react/@types/react-dom packages in your project

@leinjay
Copy link
Author

leinjay commented Jan 15, 2024

in my project:
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
which is higher than react-data-grid requires,
maybe the other reason?

@nstepien
Copy link
Contributor

What version of TypeScript do you use?

@pavlovich
Copy link

We are experiencing the exact same issue with this package. Our version info is as follows:

"typescript": "^4.7.4",
"react": "^18.2.0",
"react-data-grid": "^7.0.0-beta.42",
"react-dom": "^18.2.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"@types/node": "^16.11.41",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",

and our tsconfig file contains the following:

{
"compilerOptions": {
"target": "ES6",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"typeRoots": [
"src/types",
"node_modules/@types",
],
"include": [
"src"
]
}

Any help would be appreciated.

@amanmahajan7
Copy link
Contributor

Can you create a reproducible example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants