Skip to content

tags.script() doesn't execute when it's a child of a JSXTag  #26

@cpsievert

Description

@cpsievert

For example, when you open example.html, you should get a 'hello' alert box (but you currently get nothing).

This effectively means you can use things like shiny.ui.panel_absolute(draggable=True) inside a ui.page_navbar (because it's all one big JSX component

from htmltools import jsx_tag_create, tags, HTML, HTMLDocument

MyComponent = jsx_tag_create("MyComponent")

HTMLDocument(
  tags.script(HTML(
      "function MyComponent(props) { return React.createElement('h4', props, 'Hello World') }"
  )),
  MyComponent(
      tags.script("alert('hello')"),
      style={"color": "red"}
  )
).save_html("example.html")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions