How can I use variable from another page in dash web application

I created web application. It contains 4 pages. I want to add functionality which includes pattern-matching and dcc.Store component. This function located in page 2 but dcc.Store component in page 1. In page 2 I created “n_click” variable. So I need use this variable in page 1. I imported page 2 as module to get “n_click” variable.

But I get error:

AttributeError: module ‘pages.pg2’ has no attribute ‘n_clicks_b’

Please, help me to find the way to use variable from another page

you can put the dcc store on the main page and access it from the subpages

Also, try with the basic examples as provided in the doc (store and sharing state) as a starting point.

Hey @Sanan009 , please don’t create various topics asking the same thing.

Did you try what I suggested? I really think what you are trying to do is not necessary.

You could create a MRE. This increases your chances to get help drastically.

No, I know this method. But it is not solution for my problem.

in my application dcc.Store located in main page. So I need use variable from one page to another page

Hi, I don’t also want to create various topics asking the same thing. But I haven’t found any solution about my problem yet. Please help me to find it.