Access State From Other Pages #2487
-
Hey, my app consists of multiple pages, and I need to share the state of one page with the others. I checked the documentation, but I couldn't find any specific guidance on how to share state between multiple pages. Should I import state variables from a module to access them across pages (It actually worked!), or is there a built-in, Taipy-like way to handle this? |
Beta Was this translation helpful? Give feedback.
Answered by
FlorianJacta
Mar 10, 2025
Replies: 1 comment 2 replies
-
If your variable is defined or imported in your main file (like main.py). Then, it can be used in every page. Here is some doc. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You don't have to define all your variables in one place. The variable that should be the same for each page should only be defined once and imported into your main.py.
Sometimes, we have a root page, a page which content is shared by every page. We can define the variable there once and import it inside your main.py.
Does that make sense?