reactpy
reactpy copied to clipboard
Example app for Dynamically Loaded Components returns null
trafficstars
When running the following example:
from reactpy import component, run, web
mui = web.module_from_template(
"react@^17.0.0",
"@material-ui/[email protected]",
fallback="⌛",
)
Button = web.export(mui, "Button")
@component
def HelloWorld():
return Button({"color": "primary", "variant": "contained"}, "Hello World!")
run(HelloWorld)
I observe:
Discussed in https://github.com/reactive-python/reactpy/discussions/1105
Originally posted by AyushExel July 15, 2023
I'm following the example here https://reactpy.dev/docs/guides/escape-hatches/javascript-components.html#dynamically-loaded-components
And it works on the browser when clicking result button but on running it on my system, i get null page.
This is likely an issue with our our view that serves JavaScript modules. We need to make sure we're appropriately setting mime type headers within this view.