posit-dev / shiny-bindings

Monorepo containing Javascript packages that simplify the experience of writing custom bindings for Shiny apps
10 stars 2 forks source link

feat: ability to pass props to the react component #7

Open Gotfrid opened 4 months ago

Gotfrid commented 4 months ago

Make it possible to pass props to a React component from Python code.

Component properties are defined in Python, serialized to a dictionary, and sent to the DOM via data-props HTML attribute.

makeReactInput function receives those props, parses and sends them further to the React component. This is possible thanks to a second generic parameter which defines the shape of the props.

To showcase this new feature, the demo-pkg code is updated accordingly.