Javascript Error while Rendering #1153
-
I am trying to build a component library on top of reactpy for Nivo Charts. After following the documentation, I have imported the library nivo charts into python and imported a chart like this: from reactpy import component, run, web
nivo_module = web.module_from_template(
"react",
"@nivo/core",
fallback="⌛",
)
nivo_bar_module = web.module_from_template(
"react",
"@nivo/bar",
fallback="⌛",
)
ResponsiveBar = web.export(nivo_bar_module, "ResponsiveBar") Once imported, I am using the exported object @component
def HelloWorld():
return html.section(
ResponsiveBar({"data":data, "keys": [ 'hot dog', 'burger', 'sandwich', 'kebab', 'fries', 'donut'], "indexBy": "country", "role": "application"})
)
app = FastAPI()
configure(app, HelloWorld) I am trying to replicate the example showcased in Nivo Playground When running the uvicorn server, while rendering, I am getting a javascript error Q.) Is this a problem from the Nivo charts? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
module_from_template
is deprecated due to instability and will be removed in the next major release.For now, we suggest using the custom components API instead.