3 ms·
Here is a Snake implemented in React: Demo: http://tomocchino.github.io/react-snake/ http://tomocchino.github.io/react-snake/ Source (150 lines): https://gith
by vjeux 13y ago
Here is a Snake implemented in React:
Demo: http://tomocchino.github.io/react-snake/ http://tomocchino.github.io/react-snake/
Source (150 lines): https://github.com/tomocchino/react-snake/blob/master/src/snake.js https://github.com/tomocchino/react-snake/blob/master/src/sn...
- nilliams 13y agoCool, learning React at the mo so this is appreciated. You can remove all those autoBinds now [1] right? [1] http://facebook.github.io/react/blog/2013/07/02/react-v0-4-autobind-by-default.html http://facebook.github.io/react/blog/2013/07/02/react-v0-4-a...
- vjeux 13y agoYes, autoBind are done by default now. Also, you need to replace `class` by `className` in JSX. You can also take the advantage of getDefaultProps() instead of doing `this.props.something || 12` everywhere.