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

[BUG][Typescript] Children element type is not found on List, Edit, Show,Create component #2090

Closed
emehmet opened this issue Jul 4, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@emehmet
Copy link

emehmet commented Jul 4, 2022

Hi,
I use the examples described in the tutorial. I get this typescript error on all components.

Typescript error is;

List
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & ListProps'.

Create
Type '{ children: Element; saveButtonProps: Partial<{ href: string; target?: string | undefined; onClick?: MouseEventHandler<HTMLElement> | undefined; } & BaseButtonProps & Omit<...> & { ...; } & Omit<...>> & { ...; }; }' is not assignable to type 'IntrinsicAttributes & CreateProps'. Property 'children' does not exist on type 'IntrinsicAttributes & CreateProps'.

Edit
Type '{ children: Element; saveButtonProps: Partial<{ href: string; target?: string | undefined; onClick?: MouseEventHandler<HTMLElement> | undefined; } & BaseButtonProps & Omit<...> & { ...; } & Omit<...>> & { ...; }; }' is not assignable to type 'IntrinsicAttributes & EditProps'. Property 'children' does not exist on type 'IntrinsicAttributes & EditProps'.

Show
Type '{ children: Element[]; isLoading: boolean; }' is not assignable to type 'IntrinsicAttributes & ShowProps'. Property 'children' does not exist on type 'IntrinsicAttributes & ShowProps'.

I use

"@pankod/refine-antd": "^3.27.0",
"@pankod/refine-core": "^3.36.0",
"@pankod/refine-react-router-v6": "^3.25.2",
"@pankod/refine-simple-rest": "^3.25.6",
"@pankod/refine-strapi-graphql": "^3.25.8",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.11.41",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"typescript": "^4.7.4",
"web-vitals": "^2.1.4"
@emehmet emehmet added the bug Something isn't working label Jul 4, 2022
@omeraplak
Copy link
Member

Hey @emehmet ,
Thank you for contacting us. A similar issue has been opened before, can you check here for details?

@emehmet
Copy link
Author

emehmet commented Jul 4, 2022

When I downgrade to React In 17.0.2, this time I am getting error in code.
import ReactDOM from 'react-dom/client'; in index.tsx
React is being imported with its latest version

create-react-app installs the code accordingly.
This detail should be explained in the documents until the transition to React@18

@omeraplak
Copy link
Member

Thank you, we will publish our react@18 support soon.

for now, it may be easiest to use superplate-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants