Update component with latest session state

I realized a lot of compontents dont update on a change of session state. So when running the following code on a widget, the widget will show false after the button press.However, all of the shared components I found will remain to show true, thus getting out of sync with the session_state.

st_toggle("test", default_value=True, key="toggle")

def callback_test():
    st.session_state["toggle"] = False

st.button('callback', on_click=callback_test)

My hunch is that the react state is not changed on re-rendering and that one has to manually read in the session_state and set the react state on re-rendering. But I am too new to streamlit and my react skills are too rusty to find out how I can do this.

Thanks for the help.

Did you find a solution?