No page re-render despite change in reactive value
@iisakkirotko is already working on this.
Since Sep 7, 2023.
Assessment
This issue has not been assessed yet.
Description
On initial load, the page is not re-rendered even though the value of a reactive variable changes. In the example below, when the page is initially loaded, the value of var, as displayed in the Text component is None, even though in both the InputText and via clicking on the button, we find that the value has actually changed to become '!!!', see screenshot.
import solara
var = solara.Reactive(None)
def on_click():
print(var)
@solara.component
def BugComponent(
value: solara.Reactive[str],
on_value = None,
):
def on_change(event_value):
value.set(event_value)
if value.value is None:
value.set('!!!')
return solara.InputText(label='', value=value, on_value=on_change)
@solara.component
def Page():
BugComponent(value = var)
solara.Text(f"{var}")
solara.Button('click', on_click=on_click)
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 202
- Avg merge
- 4h 36m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from widgetti/solara
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
ghhvg Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100