Please enable JavaScript.
Coggle requires JavaScript to display documents.
02. CLEAN UP YOUR CODE (DOM elements and React components (The only…
02. CLEAN UP YOUR CODE
JSX
JSX supports self-closing tags, which are pretty good for keeping the code terse and do not require us to repeat unnecessary tags
Babel
One of the reasons Babel is so powerful is because it is highly configurable. Babel is just a tool to transpile a source file into an output file, but to apply some transformations, we need to configure it
-
Always remember to wrap your elements inside parentheses when you write them in multiple lines. In fact, JSX always gets replaced by functions, and functions written on a new line can give you an unexpected result because of automatic semicolon insertion
react-only-if
render-if
jsx-control-statements (Babel plugin) + eslintplugin-jsx-control-statements
eslint-plugin-react
-
Functional programming
-
Purity: A function is pure when there are no side-effects, which means that the function does not change anything that is not local to the functions itself
-
Currying: A common technique in FP is currying. Currying is the process of converting a function that takes multiple arguments into a function that takes one argument at a time
-
-