I’m trying to use a
st.empty() placeholder at the bottom of my page, which I write to via callback. Unfortunately, anything I write to the
st.empty() is immediately overwritten next app cycle. I was hoping to “reserve” a place at the bottom of the page, then write output there after doing some processing.
import streamlit as st def process_user_input(): user_input = st.session_state["user_input"] output = do_some_stuff_here() output_placeholder.text_area(label="Output", value=output) st.text_area(label="User Input", placeholder="Enter stuff here", key="user_input", on_change=process_user_input) output_placeholder = st.empty()
I thought this would let me write to the
output_placeholder spot, replacing it with a
st.text_area() once there was a user response.
st.text_area() DOES show up for a split second, it’s just immediately overwritten.