Skip to content

Difference between code in function an in the main of the file #24

@ponsoc

Description

@ponsoc

Hi again

please look at the code below. It only renders “another text” instead of the first item as well. When I do the same outside a function, it works fine.

import violit as vl

app = vl.App(title="test")

data = app.session_state([{"text":"text"},{"text":"another text"}], key="data")

@app.reactivity
def list():
    left, right = app.columns(2)
    for item in data.value:
        with left:
            app.text(item["text"])
        with right:
            app.selectbox("value", ["test"])

list()
app.run()

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions