react-router@v4-alpha
HashRouter
- higher-order componentMatch
elements with a component passed in via prop- Fb recommend extends
- (
{/* .jsx comments */}
)
dangerouslySetInnerHTML
- webpack's
devServer
,historyApiFallback: true
HashRouter
=>BrowserRouter
Link
- webpack
json-loader
- Seach component,
<pre>
- JSON.stringify has replacers to deal with circular objects...
[].map
preload.show.map
, no=>
?- "best practices in React are just best practices in Javascript"
- fat-arrow functions are explicitly different than
function
, it's not the same thing... - template strings
- ShowCard component
- es6 destructuring assignment
- React uses this to optimize replacing from virtual DOM to DOM
- never use map index for key
- more key stuff
- stateless functional components vs. React components
- specifying props via propTypes
- React.PropTypes.shape - this is interesting, instead of React.PropTypes.object, you can:
propTypes: {
show: shape({
poster: string,
title: string
})
}
- documentation + weak type checking
shape
helps you not be lazyshape
is nestable
<Comp {...val} />
- simplifying ShowCard component
- React tries to address state bugs by attempting to minimize the number of places that state can change
- one-way data flow
- children can notify parents via func invoke, but parents have to flow back down
getInitialState()
- return first state of component- re-render never fires on an input, captures the event and is falls on the floor
setState()
does shadow mergeforceUpdate()
is there if you need it and are interacting w/ a 3rd party- lots of questions that deal with other weird stuff