Boolean toggle switch doesn't update

I am using BooleanSwitch in my Application. My application has multi-tabs and pages. Here’s the structure for more clarity -
- pages
- tabs

In, I have the following code:

                             on=True, # True = Flow1 and False = Flow2

# Update Label of Boolean Switch


def update_switchLabel(dummy, on):

    if on == True:

        return "Flow1"


        return "Flow2"

This toggle value is saved in store element that is defined in

          # Store component for home page
          dcc.Store(id="home-store", storage_type="local"),

In, I update certain elements based on the toggle value that’s read from the store component.


                         Output("layout", "style")

                         Input("dummy-div", "value"),
                         State("home-store", "data")
def flow_update(dummy, home_store):

    print("component from home page", home_store)

    if home_store == "Flow1":
        return [{"display":"none"}]

    elif home_store == "Flow2":
        return [{"display":"inline-block"}]

When I toggle the selection, the value of home_store is not updated for some reason. Could someone review and suggest why that’s the case? home_store takes the default value and doesn’t update upon toggle. Another way to put this, is how do I check for updates to home_store and trigger a callback.

I am also checking the dash.callback_context to for objects triggered including inputs and states. But, not seeing any updates to home_store state.

@AnnMarieW would appreciate any suggestions.

Your second callback is triggered only when “dummy-div” is updated, so unless it gets updated by a different callback (not shown) that takes the toggle as Input (and not State), toggling the button will have no effect on it.

Please also note that you could have a typo, as you have “dummy_div” in the label update callback and “dummy-div” in the other.