Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import ReactDOM from 'react-dom';
- import {Router, browserHistory} from 'react-router';
- import routes from './routes';
- ReactDOM.render(
- <Router history={browserHistory} routes={routes}/>, document.getElementById('root'));
- module.exports = {
- path: '/',
- component: require('../components/app'),
- indexRoute: require('./home')
- };
- module.exports = {
- getComponent(nextState, cb) {
- require.ensure([], (require) => {
- cb(null, require('../components/home'));
- });
- }
- };
- import React, {PropTypes} from 'react';
- const App = props => (
- <section>
- <h1>My App</h1>
- <section>{props.children}</section>
- </section>
- );
- App.propTypes = {
- children: PropTypes.node.isRequired
- };
- export default App;
- import React from 'react';
- const Home = () => (
- <section>
- <h3>Home</h3>
- </section>
- );
- export default Home;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement