Functions/objects defined in the global scope do not automatically become window
properties,
so the following JS code:
function sayHello() { alert('Hello!'); }
won't work as expected if used in R like this:
tags$button("Hello!", onclick = 'sayHello()');
Instead you should explicitly export functions:
export function sayHello() { alert('Hello!'); }
and access them via the global App
object:
tags$button("Hello!", onclick = "App.sayHello()")