import streamlit as st | |
def update_text_area(): | |
# Your code to update the value of the text area | |
st.session_state.text = "Updated text" | |
if "text" not in st.session_state: | |
st.session_state["text"] = "" | |
text_area = st.text_area("Enter text", value=st.session_state["text"], height=200) | |
# Button to trigger the callback function | |
if st.button("Update text"): | |
update_text_area() | |