react-gotchas
react-gotchas copied to clipboard
Removing opinion & preference (and best practices?)
It might be a good idea to keep these tips focused more on errors than on things that are personal preference. If the documentation gets too large, less people will read it, and we're left with the same issue we started with.
Also, there are plenty of good resources out there on best practices, maybe those don't belong here as well if we want the focus of these docs to be on things that actually cause errors.
-
Example of a gotcha: Don't extend composed components. If you do this your code will break in a subtle and easily overlooked way.
-
Example of a good practice: Use helpers in
componentWillReceiveProps()
. Doing this can make your code cleaner but it's not really a "mistake." -
Example of opinion: Destructure props. This is entirely my opinion.
Thoughts / opinions?