Full Stack Software Development Blog
Fortunately for me a couple of guys on my team at work are fluent in React. I asked them to do a code review and got a lot of good feedback. As a result of the feedback the step-10-code-review-refactor branch at https://github.com/gpratte/react-todo-list has the following changes
- Use .jsx extension for components
- Use lodash for better performance for map, filter, etc.
- Consider using destructuring syntax to avoid constantly referencing state or props, e.g. const { foo, bar, baz } = this.state
- Use lodash for better performance for map, filter, etc.
- Consistently use arrow methods vs regular old functions
- Count should probably be in the component state
- Unless there are things like dashes/dots, quotes are unnecessary for object keys
- With ES2015 you could use template literal for text substitution
- Spelled concatenate wrong
- Avoid creating new functions in render, this is bad for scalability as each render will create new functions that need to be garbage collected
Informative blog. Thanks for sharing.
ReplyDeleteFull Stack Online Training
Full Stack Training
Great work.And these changes are really important to make user friendly software blog.Thanks for sharing.We are a global IT solutions company provide full-cycle services in the areas of software development, web-based enterprise solutions, web application and portal development. web development pune| web development pune
ReplyDeleteGreat blog thanks for sharing the post.
ReplyDeleteFull Stack Training in Chennai | Certification | Online Training Course | Full Stack Training in Bangalore | Certification | Online Training Course | Full Stack Training in Hyderabad | Certification | Online Training Course | Full Stack Training in Pune | Certification | Online Training Course | Full Stack Training | Certification | Full Stack Online Training Course