Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whener feed mapping into router getting this below error. #231

Open
nagarajach opened this issue May 7, 2018 · 3 comments
Open

Whener feed mapping into router getting this below error. #231

nagarajach opened this issue May 7, 2018 · 3 comments

Comments

@nagarajach
Copy link

nagarajach commented May 7, 2018

Hello StephenGrider,

After added Routes to Router getting this below error.
Could you please help me to get out of this.

Uncaught TypeError: Cannot read property 'func' of undefined
at Object.exports.__esModule (bundle.js:25555)
at webpack_require (bundle.js:20)
at Object. (bundle.js:22611)
at Object.exports.__esModule (bundle.js:22775)
at webpack_require (bundle.js:20)
at Object.exports.__esModule (bundle.js:22447)
at webpack_require (bundle.js:20)
at Object. (bundle.js:68)
at webpack_require (bundle.js:20)
at Object. (bundle.js:47)

Thank You

@nagarajach
Copy link
Author

After I add import statement of Router into index.js like below
import { Router, browserHistory} from 'react-router';
getting this error

@etseidler
Copy link

@nagarajach perhaps this is addressed in lectures beyond the last one that i watched, but what i found is that you cannot use a <Link> outside of a <Router>. I changed my app.js to the following, installed the necessary npm packages, and got the app to work.

import React, { Component } from 'react';
import Header from './header';
import { Router } from 'react-router-dom';
import createBrowserHistory from 'history/createBrowserHistory'

const customHistory = createBrowserHistory()

export default class App extends Component {
  render() {
    return (
      <Router history={customHistory}>
        <div>
          <Header />
        </div>
      </Router>
    );
  }
}

@nagarajach
Copy link
Author

nagarajach commented May 8, 2018

@eric Thanks for your Quick reply.

I got fixed this error with installed latest version [email protected] instead of [email protected] as you mentioned in the latest video Lesson-114.

Thank You So Much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants