What are some of the Best Practices for Writing React Code?
I know many of you on HN have specific workflow that you follow for writing code. And also have some standard practices that you follow in your organization.
What are some of the practices that you follow while working on react project?
use functional argument on setState if you depend after call directly on the updated state
use arrow functions within the class component to auto-bind them to the component, if it gets called from jsx
May others add things they do. I’m pretty a straight forward guy. Keep it simple, no linting or such stuff. Only prettier to keep a consisting look of the code.
Sebastian
Hmm do you target something specific?
Things that come to my mind and I also use:
May others add things they do. I’m pretty a straight forward guy. Keep it simple, no linting or such stuff. Only prettier to keep a consisting look of the code.