DEV Community

Discussion on: 8 Practices In React That Will Crash Your App In The Future

Collapse
 
puritanic profile image
Darkø Tasevski • Edited

Declaring Default Parameters Over Null

This is a Javascript thingie, not React specific.

Edit: As far as I can see none of those issues listed have nothing to do with React API, all of these are just Javascript gotchas, and you can have the same issues in the Vue, Angular, [nameYourFrameworkHere] projects.

By using type checker helper like Flow or Typescript you can get rid of the half problems listed here, if you don't want to do that, guard your logic for unforeseen situations and name your variables correctly, so that you know what is an array and what is an object.