React Component Lifecycle
- getInitialState
- getDefaultProps
- componentWillMount
- componentDidMount
- shouldComponentUpdate (Update only)
- componentWillUpdate (Update only)
- componentWillReceiveProps (Update only)
- render
React Component Lifecycle
Put this in your config.fish
run
code path/to/project
TLDR: a React component should either manage its own state, or expose a callback so that its parent can. But never both.
Sometimes our first impulse is for a component to entirely manage its own state. Consider this simple theater seating picker that has a letter for a row, and a number for a seat. Clicking the buttons to increment each value is hardly the height of user-interface design, but never mind - that's how it works:
/* @flow */
var React = require('react');
var Letter: React.ReactClass = React.createClass({
getInitialState: function(): any {
#!/bin/sh | |
# Use SourceGear DiffMerge as mergetool for git in cygwin. | |
# git config --global mergetool.diffmerge.cmd "diffmergetool.sh \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\"" | |
# git config --global mergetool.diffmerge.trustExitCode false | |
# git difftool -t diffmerge branch1..branch2 | |
# Reference: http://www.tldp.org/LDP/abs/abs-guide.pdf | |
library=githelperfunctions.sh |