reactpy icon indicating copy to clipboard operation
reactpy copied to clipboard

Example app for Dynamically Loaded Components returns null

Open rmorshea opened this issue 2 years ago • 1 comments
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:

image

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. Screenshot 2023-07-15 at 8 20 12 PM

rmorshea avatar Jul 15 '23 16:07 rmorshea

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.

Archmonger avatar Jul 16 '23 10:07 Archmonger