You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is no way to pass events from a react htmlwidget to Shiny. We have very briefly discussed the following approaches. I'd like to target this for next release.
Prop
One approach (shown in pull) would be to use a special prop that would get evaluated in react-tools.js. This is easy but only allows a single event, could interfere with a real prop (unlikely but possible), and requires a one argument function.
Wrapper Function in R
Another approach would add a function in R, such as withShinyEvent( reactwidget, ... ), that attaches an event handler to a widget.
Custom JavaScript from Author
@pvictor demonstrates how a widget author might write a custom component in JavaScript in reactcolors. This provides fairly unlimited flexibility but requires a higher level of author skill.
Are there other approaches not considered?
The text was updated successfully, but these errors were encountered:
Currently, there is no way to pass events from a react
htmlwidget
to Shiny. We have very briefly discussed the following approaches. I'd like to target this for next release.Prop
One approach (shown in pull) would be to use a special
prop
that would get evaluated inreact-tools.js
. This is easy but only allows a single event, could interfere with a realprop
(unlikely but possible), and requires a one argument function.Wrapper Function in R
Another approach would add a function in
R
, such aswithShinyEvent( reactwidget, ... )
, that attaches an event handler to a widget.Custom JavaScript from Author
@pvictor demonstrates how a widget author might write a custom component in
JavaScript
in reactcolors. This provides fairly unlimited flexibility but requires a higher level of author skill.Are there other approaches not considered?
The text was updated successfully, but these errors were encountered: