You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although callbacks are often preferred to avoid extra reruns, our first 'John Doe'/'Jane Doe' example can be modified by adding [`st.experimental_rerun`](/library/api-reference/control-flow/st.experimental_rerun) instead. If you need to acces data in `st.session_state` before the button that modifies it, you can include `st.experimental_rerun` to rerun the script after the change has been committed. This means the script will rerun twice when a button is clicked.
210
+
Although callbacks are often preferred to avoid extra reruns, our first 'John Doe'/'Jane Doe' example can be modified by adding [`st.rerun`](/library/api-reference/control-flow/st.rerun) instead. If you need to acces data in `st.session_state` before the button that modifies it, you can include `st.rerun` to rerun the script after the change has been committed. This means the script will rerun twice when a button is clicked.
If your process affects content above your form, another alternative is using an extra rerun. This can be less resource-efficient though, and may be less desirable that the above options.
194
194
@@ -213,15 +213,15 @@ with st.form('addition'):
213
213
# a second rerun when the form is submitted to update the value above.
* Every form must contain a `st.form_submit_button`.
224
-
*`st.button` and `st.download_button` cannot be added to a form.
225
-
*`st.form` cannot be embedded inside another `st.form`.
226
-
* Callback functions can only be assigned to `st.form_submit_button` within a form; no other widgets in a form can have a callback.
227
-
* Interdependent widgets within a form are unlikely to be particularly useful. If you pass `widget1`'s value into `widget2` when they are both inside a form, then `widget2` will only update when the form is submitted.
223
+
- Every form must contain a `st.form_submit_button`.
224
+
-`st.button` and `st.download_button` cannot be added to a form.
225
+
-`st.form` cannot be embedded inside another `st.form`.
226
+
- Callback functions can only be assigned to `st.form_submit_button` within a form; no other widgets in a form can have a callback.
227
+
- Interdependent widgets within a form are unlikely to be particularly useful. If you pass `widget1`'s value into `widget2` when they are both inside a form, then `widget2` will only update when the form is submitted.
description: st.experimental_rerun will rerun the script immediately.
5
5
---
6
6
7
-
<Important>
8
-
9
-
This is an experimental feature. Experimental features and their APIs may change or be removed at any time. To learn more, click [here](/library/advanced-features/prerelease#experimental-features).
<Autofunctionfunction="streamlit.experimental_rerun"deprecated={true}deprecatedText="<code>st.experimental_rerun</code> was deprecated in version 1.27.0. Use <a href='/library/api-reference/control-flow/st.rerun'><code>st.rerun</code></a> instead."/>
0 commit comments