I can’t get any js function in streamlit to work, the return value is always 0, no matter how I tried to write it. For instance
anonymous = st_javascript("""
(() => {
return 2;
})()
""")
st.write(f"JavaScript returned: {anonymous}")
What am I doing wrong here? Chatgpt and claude couldn’t help, nor did I see any helpfull posts here.
Can someone provide the correct syntax?