-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
i have some project and i wanna build wp theme with create-react wptheme but route is not working
i already follow some tutorial in http://michaelsoriano.com/wordpress-theme-react-part-2-routes-context/ but router still not working
this my code below
import React from 'react'
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import Archive from './templates/Archive';
import Single from './templates/Single';
const Routes = () => {
return (
<Router>
<Switch>
<Route exact path="/" component={Archive} />
<Route path="/page" component={Single} />
</Switch>
</Router>
)
}
export default Routes
in the single page
import React from 'react'
const Single = (props) => {
return (
<div className="Post">
PAge Single
</div>
)
}
export default Single
i use react-router-dom version 5.3.0
Metadata
Metadata
Assignees
Labels
No labels