In JavaScript, you can adopt ES6 syntax to make your code cleaner. Don't Forget key Prop With map in JSX Always assign a unique value to the prop to every JSX element while mapping from an array. Use Ternary Operator instead of if/else if Statements makes your code bulky.

5m read timeFrom dev.to
Post cover image
Table of contents
VS Code is Highly Recommended as IDEUse ES6 SyntaxDon't Forget key Prop With map in JSXComponent Name Should be in PascalCaseVariable & Function Names Should be in camelCaseID & Class Names Should be in kebab-caseAlways Check null & undefined for Objects & ArraysAvoid Inline StylingAvoid DOM ManipulationAlways Remove Every Event Listener in useEffectAvoid Repetition, Use Generic ComponentsDon’t Throw Your Files RandomlyFunctional Components Are RecommendedCreate a Habit of Writing Helper FunctionsUse Ternary Operator Instead of if/else if StatementsMake index.js File Name to Minimize Importing ComplexityDestructuring of PropsDon't Try to Access Modified State Variable in the Same FunctionUse === Operator instead of ==
30 Comments

Sort: