Creating a React Component

In notebook:
Building Modern Web Apps
Created at:
2016-01-20
Updated:
2016-01-20
Tags:
React libraries JavaScript Webpack
  var React = require('react');

var Hello = React.createClass({
    render: function(){
        return <div>Hello, {this.props.name}</div>
    }
});

React.render(<Hello name="henrik"/>, document.body);
The ​render​ method is a basic building block of React that you see in every app.
It returns the state we want in a particular time

Uses JSX to insert angle brackets

There's no base html file, only an app.js. The webpack dev servers creates the index.html file (with some basic setup)

About Flux

you create action, like an internal SDK of your app, every time you modify data it triggers a set of actions, that updates the view
Webpack runs everything through Babel, that is also JSX aware