- $
git clone
/ download this repo - $
npm install
- $
npm start
- then you should be able to a game interface
we're also using some features from ES6, a recent version of JavaScript. In this tutorial, we're using arrow functions, Spread syntax, classes, let, and const statements. You can use Babel REPL to check what ES6 code compiles to.
What is React?
-
React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes.
-
Build encapsulated components that manage their own state, then compose them to make complex UIs. Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.
-
A Simple Component React components implement a render() method that takes input data and returns what to display. This example uses an XML-like syntax called JSX. Input data that is passed into the component can be accessed by render() via this.props.
-
A Stateful Component In addition to taking input data (accessed via this.props), a component can maintain internal state data (accessed via this.state). When a component's state data changes, the rendered markup will be updated by re-invoking render().
- game
- board
- sqaure
- this.props
- this.state
- this.setState
- Developer Tools The React Devtools extension for Chrome and Firefox lets you inspect a React component tree in your browser devtools.