Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React-router warnings

See original GitHub issue

First off, love this app! Rely on it a lot.

I noticed that when I was using react-router to navigate (Link and history.push) it was throwing me an error of

TypeError: e is not a function r.define src/views/DiscoverView.js:38 35 | componentDidMount() { 36 | scripts.concat(Promise.resolve()).reduce((loaded, loading) => { 37 | return loaded.then(script => { **> 38 | new Function(with (this) {eval(arguments[0])}** | ^ 39 | ).call(window, script); 40 | 41 | return loading;

I managed to fix it by manually going into the appfairy generated view page and adding a “$” in front of it, changing it to “$ {eval(arguments[0])}”, and now it works fine with react-router

Not sure whether its just the way I am using appfairy, or generating the pages, but posting this here just in case other people have the same issue

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

JeffreyYu2018commented, Feb 24, 2020

Thanks, this worked for me too.

Instrumedleycommented, May 30, 2022

to be fair, the solution provided here seems unreadable. He says and adding a " {eval(arguments[0])}", and now it works fine with react-router I don’t know if since the day he posted git might be parsing some character he wrote there, but I don’t quite understand what Im supposed to do. Can anyone help?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Router Warning: <Route> elements should not change ...
I am trying to understand the nuances behind a specific warning I see when working with React Router. I was trying to setup...
Read more >
React Router gives warning, but the routes exist and ... - Reddit
React Router gives warning, but the routes exist and the components are correctly rendered. What's the issue? I have two routes "/" and ......
Read more >
Warning Issues with React-Router-Dom?
Hi everyone,. Wanted to ask if anyone following the Mastering React course ran into these warnings and errors regarding route registration.
Read more >
react-router-modal__removes-warnings - npm package - Snyk
The npm package react-router-modal__removes-warnings was scanned for known vulnerabilities and missing license, and no issues were found. Thus ...
Read more >
Invalid Hook Call Warning - React
You are probably here because you got the following error message: Hooks can only be called inside the body of a function component....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found