tangway / flag-guessing-game-frontend

0 stars 0 forks source link

adding PropTypes and defaultProps #36

Open tangway opened 6 months ago

tangway commented 6 months ago

decided to look into implementing PropTypes as i got annoyed at the linting errors for prop validation from https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prop-types.md

i had to be convinced though, it's one of those things that is not absolutely needed for the app to work so i looked up the benefits you could get from using it:

and for more convincing i figured i'll check out examples of large production-grade, open-source React apps to see if they use it:

tangway commented 6 months ago

after reading this i decided on not using defaultProps and went back to using default parameters for react component function: https://sophiabits.com/blog/stop-using-defaultprops