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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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