You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to add my own files to the Scope but the Readme is not clear enough on what localFileContent and baseScope means:
import{importCode}from'react-runner'import*asYourPkgfrom'your-pkg'constbaseScope={/* base globals */}constscope={
...baseScope,// scope used by import statementimport: {constants: {A: 'a'},'your-pkg': YourPkg,'./local-file': importCode(localFileContent,baseScope),},}
If I have import Button from "./button"; I would assume the following code is what's expected (taking into account that importCode's signature expects a string as the first param and Scope as the second. However I get the error 'Button is not defined'.
On top of that, if I add scope to useRunner, my component enters into an infinite rerender loop, even if I just add scope:{}, which I don't know what causes it or how to stop it. Here is my current code, very minimalistic for now. Any help on how to solve any of the two issues would be greatly appreciated
And this is the error on the browser' console when trying to look at the code any time I try to set scope. The issue is not with useEffect itself as I've done tests removing it completely.
684react-dom.development.js:86Warning: Maximumupdatedepthexceeded.ThiscanhappenwhenacomponentcallssetStateinsideuseEffect,butuseEffecteitherdoesn't have a dependency array, or one of the dependencies changes on every render.
at UseRunner (http://localhost:3000/main.8b244c7fd6a37a177bc4.hot-update.js:101:11)
The text was updated successfully, but these errors were encountered:
Hi!
I would like to add my own files to the Scope but the Readme is not clear enough on what
localFileContent
andbaseScope
means:If I have
import Button from "./button";
I would assume the following code is what's expected (taking into account that importCode's signature expects a string as the first param and Scope as the second. However I get the error 'Button is not defined'.On top of that, if I add scope to
useRunner
, my component enters into an infinite rerender loop, even if I just addscope:{}
, which I don't know what causes it or how to stop it. Here is my current code, very minimalistic for now. Any help on how to solve any of the two issues would be greatly appreciatedAnd this is the error on the browser' console when trying to look at the code any time I try to set scope. The issue is not with
useEffect
itself as I've done tests removing it completely.The text was updated successfully, but these errors were encountered: