My app is not routing properly, and I can’t understand where’s an error.
The app is using react-router v4 beta, consists of two pages and these two pages are displayed on one page one by one. Here’s the structure of result code from react extension:
And here’s the code:
import React from 'react'
import { render } from 'react-dom'
import Route from 'react-router-dom/Route'
import { BrowserRouter } from 'react-router-dom'
import Landing from './Landing'
import Products from './Products'
import 'bootstrap/dist/css/bootstrap.css'
const App = React.createClass({
render () {
return (
<BrowserRouter>
<div className='app'>
<Route exact pattern='/' component={Landing} />
<Route pattern='/products' component={Products} />
</div>
</BrowserRouter>
)
}
})
render(<App />, document.getElementById('app'))