Skip to content

warning.js:36 Warning: Failed prop type: The prop history is marked as required in Router, but its value is undefined. #1

@leongaban

Description

@leongaban

Hi getting the error in the title based on the following code:

import React from 'react'
import { browserHistory, hashHistory, Router } from 'react-router'
// import createMemoryHistory from 'history/lib/createMemoryHistory'
import { Route, Switch } from 'react-router-dom'
import Portfolio from './portfolio/Portfolio'
import Home from './home/Home'
import NoMatch from './NoMatch'

// const history = createMemoryHistory(location);
// console.log('history', history);

const Routes = () => {
    return (
        <Router history={browserHistory}>
        	<Route exact={ true } path="/" component={ Home }/>
        	<Route exact={ true } path="/portfolio" component={ Portfolio }/>
        	<Route component={ NoMatch } />
        </Router>
    );
}

export default Routes

screen shot 2017-07-07 at 8 47 01 am

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions