Hand this kit a @posit-dev/shinyreact module instead of relying on
window.shinyreact. The served page's shinyreact.js sets that global; an
app that bundles @posit-dev/shinyreact itself instead calls this once at
startup with the module it imported.
Not done with a static import here: that would make every consumer,
including the IIFE build, bundle shinyreact and its own React copy, and
two React copies on one page break every hook.
Hand this kit a
@posit-dev/shinyreactmodule instead of relying onwindow.shinyreact. The served page's shinyreact.js sets that global; an app that bundles@posit-dev/shinyreactitself instead calls this once at startup with the module it imported.Not done with a static import here: that would make every consumer, including the IIFE build, bundle shinyreact and its own React copy, and two React copies on one page break every hook.