Created
March 23, 2017 17:34
-
-
Save m242/cbfd7b9db5fd2be18fdcdbc6dfe95de1 to your computer and use it in GitHub Desktop.
Inferno router wildcard issue 962
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Inferno from 'inferno'; | |
import Component from 'inferno-component'; | |
import { Router, Route } from 'inferno-router'; | |
import createBrowserHistory from 'history/createBrowserHistory'; | |
const browserHistory = createBrowserHistory(); | |
class App extends Component { | |
constructor(props) { | |
super(props); | |
} | |
render() { | |
return ( | |
<Router history={ browserHistory }> | |
<Route path="/" component={ Home }/> | |
<Route path="/about" component={ Site }> | |
<Route path="/features" component={ Features }/> | |
</Route> | |
<Route path="/:artist" component={ Artist }> | |
<Route path="/:uri" component={ ArtistTrack }/> | |
</Route> | |
</Router> | |
); | |
} | |
} | |
class Home extends Component { | |
constructor(props) { | |
super(props); | |
} | |
render() { | |
return (<div>Home</div>); | |
} | |
} | |
class Site extends Component { | |
constructor(props) { | |
super(props); | |
} | |
render() { | |
return (<div>Site {this.props.children}</div>); | |
} | |
} | |
class Features extends Component { | |
constructor(props) { | |
super(props); | |
} | |
render() { | |
return (<div>Features</div>); | |
} | |
} | |
class Artist extends Component { | |
constructor(props) { | |
super(props); | |
} | |
render() { | |
return (<div>Artist {this.props.children}</div>); | |
} | |
} | |
class ArtistTrack extends Component { | |
constructor(props) { | |
super(props); | |
} | |
render() { | |
return (<div>ArtistTrack</div>); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment