https://www.youtube.com/watch?v=nQo0EdHNjto
- reusable components
- props over state
- prop === state => problem!
- stateless components
- easy to unit test
- props over state
- PropTypes are serious
- props immutable!
- shouldComponentUpdate improved
- console.warn = (warning) => throw new Error(‘warning: ‘, warning);
- npm install eslint-plugin-react
- props immutable!
- break html out into components (8:34)
- children don’t have to be children
- can be used to declare stuff
- render () { React.Children.forEach(this.props.children, (child) => { if(child.Type === Header) … } ) }
- cross behavior
- mixins: not (still around??)
- composition: meh
- Higher order component: yay! (13:25)
- withValidation(AnyComponent) => { return class WithValidation... }
-
- decorators: awesome
- pay attention to CSS class names
- standard!
- automate it! example: https://github.com/brentertz/react-suitcssify
- separate ui components and app components
- compose components with logic + ui components
- performance
- check React.addons.Perf
- implement shouldComponentUpdate
- dom manipulation… bad
https://www.youtube.com/watch?v=AwofAAThsx0
- Document everything
- proptypes
- live doc (code mirror)
- usage examples
- Component guidelines
- lint everything
- tests?
- Rules
- keep things minimal
- deprecate stuff and changing API is tough when others teams are using
- mirror DOM where possible (not sure)
- good naming convetions! (speaker talks about a blog post 18:00 http://davidwells.io/react-prop-type-best-practices/)
- jsdoc for comment proptypes
- keep things minimal
- use PostCSS
- ending of global css
- localized styles via PostCSS + CSS Modules (incredible! 24:00)
- http://davidwells.io/19-open-source-react-component-libraries-to-use-in-your-next-project/
https://www.youtube.com/watch?v=Yy7gFgETp0o
- WOW!