DEV Community

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

Collapse
 
dezfowler profile image
Derek Fowler

As others have mentioned, this post is a great example of why TypeScript or another type checker vastly improve your code reliabilty as it would have solved the first six issues.

The last two are about validating user input which is always a good idea. With the particular example given in number 7 (the first one), values passed in the querystring should be URL encoded first and foremost which would solve the problem with the '/'. Additional validation to restrict the characters could then be done with a Regex but always with appropriate server-side validation also in place.