[React snippets] from Udacity Nanodegree #React
Udacity HTML, CSS, JS Style Guide
A good function should follow the "DOT" rule:
Composition is to combine simple functions to build more complicated ones
Declarative code vs imperative code
Data-Binding
React uses JavaScript objects to create React elements
React.createElement( /* type */, /* props */, /* content */ );
/* type */
either a string or a React Component can be a string of any existing HTML element (e.g. 'p', 'span', or 'header') or you could pass a React component (JSX)ReactDOM.render(/* React.createElement() */ , /* DOM Obj */ )
array.map(ele => ele)
array.filter(ele => ele.length < 6)