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

Look into leaning into TypeScript more than Prop Types #816

Open
harsh183 opened this issue Jun 8, 2024 · 0 comments
Open

Look into leaning into TypeScript more than Prop Types #816

harsh183 opened this issue Jun 8, 2024 · 0 comments

Comments

@harsh183
Copy link
Member

harsh183 commented Jun 8, 2024

The Wiki mentions:

Although the propTypes for the React Components is not required, it will be added gradually in the future for all existing components in FrontEnd. So please start to learn about type-checking with propTypes add it to your components.

I think the libraries and js world in general have moved to a direction using typescript types more heavily and being able to use it beyond just component props sounds really useful too. Typescript checking can be gradually introduced (similar to prop types), checks on build time (vs run time on prop types). However prop types may be useful for external API data, and from what I can gather, the use cases don't overlap a 100%. It also looks like Prop Types can be inferred from typescript definitions.

Some interesting links I saw:

https://blog.logrocket.com/comparing-typescript-and-proptypes-in-react-applications/

https://stackoverflow.com/questions/41746028/proptypes-in-a-typescript-react-application

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

No branches or pull requests

1 participant