Skip to content

此脚手架在配置react-router时候,会报错: Uncaught TypeError: Cannot read property ‘location’ of undefined  #1

@zdJOJO

Description

@zdJOJO
import React, { Component } from 'react';
import ReactDOM from 'react-dom';

import { Router, Route, hashHistory } from 'react-router'

import './index.less';

import App from './view/app'
import MainPage from './view/mainPage'
import Home from './view/home'
import Second from './view/second'

ReactDOM.render(
<Router history={hashHistory}>
    <Route path='/' component={App}>
        <Route component={Home} />
    </Route>
</Router>,
document.getElementById('root')
);

具体问题请看: http://react-china.org/t/react-router-uncaught-typeerror-cannot-read-property-location-of-undefined/11416/1

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