We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
render is not defined
solid-js/web
Using render from solid-js/web when it is imported as a namespace
render
import * as solid_web from "solid-js/web" solid_web.render(() => <App/>, root)
causes an error:
Uncaught ReferenceError: render is not defined
https://playground.solidjs.com/anonymous/aaaa8129-cbf3-4f01-9e67-f9e81f8f094a
The text was updated successfully, but these errors were encountered:
So the reason this happens is because we patch render to set window.dispose with a regex... We replace render( with window.dispose = render(
render(
window.dispose = render(
So in your case the code that is generated is:
import { template as _$template } from "solid-js/web"; import { delegateEvents as _$delegateEvents } from "solid-js/web"; import { createComponent as _$createComponent } from "solid-js/web"; import { insert as _$insert } from "solid-js/web"; const _tmpl$ = /*#__PURE__*/_$template(`<button type="button">`); import * as solid_web from "solid-js/web"; import * as solid from "solid-js"; function Counter() { const [count, setCount] = solid.createSignal(1); const increment = () => setCount(count() + 1); return (() => { const _el$ = _tmpl$(); _el$.$$click = increment; _$insert(_el$, count); return _el$; })(); } solid_web.window.dispose = render(() => _$createComponent(Counter, {}), document.getElementById("app")); _$delegateEvents(["click"]);
I'm not sure what the right strategy is here. Maybe just writing const render = solid_web.render; would help?
const render = solid_web.render;
Sorry, something went wrong.
yeah I know how to get around this. Just not an obvious error to hit. Maybe something that could be considered when transforming the code
No branches or pull requests
Using
render
fromsolid-js/web
when it is imported as a namespacecauses an error:
https://playground.solidjs.com/anonymous/aaaa8129-cbf3-4f01-9e67-f9e81f8f094a
The text was updated successfully, but these errors were encountered: