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

Fix:#643 #644

Closed
wants to merge 1 commit into from
Closed

Fix:#643 #644

wants to merge 1 commit into from

Conversation

itsadijmbt
Copy link

Thanks for contributing!

fix :#643
In " Typing Component Props " under " Useful React Prop Type Examples " , In " Functional Components " under 3rd example , example given for children Element as props ( JSX.Element ) is incorrect it produce errors in new versions , instead React.ReactElement is suggested method to use .

So changed it to React.ReactElement

image

image

@itsadijmbt
Copy link
Author

Fix : #643

Issue:
I acknowledge the issue regarding the use of JSX.Element in the examples provided in the "Typing Component Props" and "Functional Components" sections. We appreciate the detailed feedback and understand the inconvenience it may have caused. We are committed to ensuring that our documentation is updated and accurate to provide a seamless development experience.

Resolution:
In response to this, i have updated the examples to replace JSX.Element with React.ReactElement. This change aligns with the latest versions of React and TypeScript, ensuring compatibility and preventing type errors that developers, like yourself, have encountered.

Changes Made:
Updated the "Typing Component Props" section to replace the JSX.Element typing with React.ReactElement for children props. This provides accurate typing that aligns with current React and TypeScript standards.
In the "Functional Components" section, the third example has been revised to use React.ReactElement to prevent any potential type errors and ensure compatibility with the latest React versions.

Files Changed:
basic-type-examples.md
function-components.md

ScreenShots:
image
image

@filiptammergard
Copy link
Collaborator

It should be React.JSX.Element, see #643 (comment). Update it accordingly and run yarn gen-readme and it will be accepted.

@filiptammergard
Copy link
Collaborator

Fixed in #659

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

Successfully merging this pull request may close these issues.

2 participants