Skip to content

Instantly share code, notes, and snippets.

@eyakcn
Last active January 23, 2016 13:00
Show Gist options
  • Select an option

  • Save eyakcn/3c89ba5ee79cd6635369 to your computer and use it in GitHub Desktop.

Select an option

Save eyakcn/3c89ba5ee79cd6635369 to your computer and use it in GitHub Desktop.
Reactjs
<input ref={node => { this.input = node; }} />
Things you should never do inside a reducer:
Mutate its arguments;
Perform side effects like API calls and routing transitions;
Calling non-pure functions, e.g. Date.now() or Math.random().
TodoList.propTypes = {
onTodoClick: PropTypes.func.isRequired,
todos: PropTypes.arrayOf(PropTypes.shape({
text: PropTypes.string.isRequired,
completed: PropTypes.bool.isRequired
}).isRequired).isRequired
}
Footer.propTypes = {
onFilterChange: PropTypes.func.isRequired,
filter: PropTypes.oneOf([
'SHOW_ALL',
'SHOW_COMPLETED',
'SHOW_ACTIVE'
]).isRequired
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment