diff --git a/src/client/packages/idom-client-react/src/components.js b/src/client/packages/idom-client-react/src/components.js index 5caed180e..9383e1f5f 100644 --- a/src/client/packages/idom-client-react/src/components.js +++ b/src/client/packages/idom-client-react/src/components.js @@ -34,8 +34,6 @@ export function Element({ model }) { } else { return null; } - } else if (model.tagName == "script") { - return html`<${ScriptElement} script=${model.children[0]} />`; } else if (model.importSource) { return html`<${ImportedElement} model=${model} />`; } else { @@ -58,12 +56,6 @@ function StandardElement({ model }) { ); } -function ScriptElement({ script }) { - const el = React.useRef(); - React.useEffect(eval(script), [script]); - return null; -} - function ImportedElement({ model }) { const layoutContext = React.useContext(LayoutContext); diff --git a/src/idom/html.py b/src/idom/html.py index 7daaddce8..2dc9a22e6 100644 --- a/src/idom/html.py +++ b/src/idom/html.py @@ -150,7 +150,7 @@ - :func:`template` """ -from .core.vdom import VdomDict, make_vdom_constructor +from .core.vdom import make_vdom_constructor # Dcument metadata @@ -253,22 +253,6 @@ del_ = make_vdom_constructor("del") ins = make_vdom_constructor("ins") -# Scripting - - -def script(content: str) -> VdomDict: - """Create a new `<{script}> `__ element. - - Parameters: - content: The text of the script should evaluate to a function. This function - will be called when the script is initially created or when the content of the - script changes. The function may optionally return a teardown function that is - called when the script element is removed from the tree, or when the script - content changes. - """ - return {"tagName": "script", "children": [content]} - - # Table content caption = make_vdom_constructor("caption") col = make_vdom_constructor("col")