Skip to content

Components appear to be loaded in duplicate #331

@mjgorman

Description

@mjgorman

Version: solara==1.22.0

When attempting to troubleshoot some things I dropped a few print statements into a component which revealed that they were being run multiple times on the first page load which seemed strange to me. If there is anything blocking it doubles the blocking time.

Example to reproduce:

@solara.component                                                                                                                                               
def Fake():
    print("called Fake")
    sleep(2)
    loading.value = False

@solara.component
def Page():
    with solara.Column():
        solara.Title("Cameo Deployments")
        with solara.Sidebar():
            with solara.Card("Controls"):
                with solara.Column():
                    solara.SliderInt(label="Hours of commits", value=hours)
    solara.Info("Most Recent Commits")

    with solara.Card():
        with solara.Column():
            solara.ProgressLinear(loading.value)
            Fake() 

Output upon starting:

➜  cameo2_solara solara run sol.py
Solara server is starting at http://localhost:8765
called Fake
called Fake

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions