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

React-router warnings #11

Open
Geofflew opened this issue Apr 18, 2019 · 7 comments
Open

React-router warnings #11

Geofflew opened this issue Apr 18, 2019 · 7 comments

Comments

@Geofflew
Copy link

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

@tnici
Copy link

tnici commented Jul 2, 2019

Same thing for me. Thanks for posting your workaround.

@constantinX
Copy link

Thanks a lot. It is working for me.

@JeffreyYu2018
Copy link

Thanks, this worked for me too.

@DAB0mB
Copy link
Owner

DAB0mB commented Nov 22, 2020

Your solution might have potential side effects because you run evaluation on the same scope, I would need more info inorder to tackle that, have an example repo or something

@hosseinSey
Copy link

First, great solution! thanks
I had the same issue when using the router and used the $ workaround to solve it but appreciate a more sustainable solution

@Instrumedley
Copy link

I have the same issue. In my case is not a warning, but an error and the solution provided here did not work although it's not really a proper solution anyway since it will require that manual change every time the views are updated. Any news on this?

@Instrumedley
Copy link

Instrumedley commented 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?

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

7 participants