mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-10 18:02:51 +00:00
22 lines
592 B
JavaScript
22 lines
592 B
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import {browserHistory, Router, Route, IndexRoute} from 'react-router';
|
|
|
|
import Index from './pages/Index';
|
|
|
|
class App extends React.Component{
|
|
render(){
|
|
return(
|
|
<div>{React.cloneElement(this.props.children, this.props)}</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
ReactDOM.render((
|
|
<Router history={browserHistory}>
|
|
<Route path="/" component={App}>
|
|
<IndexRoute component={Index}/>
|
|
<Route path="/test" component={Index}/>
|
|
</Route>
|
|
</Router>
|
|
),document.getElementById('app')); |