Sha256: 03ec1d2d085ff6fa1936e796fc178ae31f05b669a4b61ba3bb61e16ad8eac1b7

Contents?: true

Size: 707 Bytes

Versions: 3

Compression:

Stored size: 707 Bytes

Contents

import React, { PropTypes } from 'react';
import HelloWorld from '../components/HelloWorld';

// Simple example of a React "smart" component
export default class HelloWorldContainer extends React.Component {
  static propTypes = {
    name: PropTypes.string.isRequired, // this is passed from the Rails view
  };

  constructor(props) {
    super(props);

    // How to set initial state in ES6 class syntax
    // https://facebook.github.io/react/docs/reusable-components.html#es6-classes
    this.state = { name: this.props.name };
  }

  updateName = (name) => { this.setState({ name }); };

  render() {
    return (
      <HelloWorld name={this.state.name} updateName={this.updateName} />
    );
  }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
react_on_rails-6.2.1 lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/HelloWorldContainer.jsx
react_on_rails-6.2.1.rc.3 lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/HelloWorldContainer.jsx
react_on_rails-6.2.1.rc.2 lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/HelloWorldContainer.jsx