classtranscribe / FrontEnd

The React + Redux Frontend for ClassTranscribe
https://classtranscribe.illinois.edu
Other
25 stars 27 forks source link

Look into leaning into TypeScript more than Prop Types #816

Open harsh183 opened 3 weeks ago

harsh183 commented 3 weeks ago

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