Batch updates #986
Unanswered
edan-bainglass
asked this question in
Q&A
Replies: 1 comment
-
|
Hey! This is indeed expected behaviour at this point. We're looking to improve the situation once 2.0 releases (which shouldn't be too far now). Take a look at this issue, as well as the Reacton pull request. The way to currently accomplish update batching (from #637): import solara
import reacton.core
text = solara.reactive("Initial text")
@solara.component
def Page():
rc = reacton.core.get_render_context()
print("Render with: ", text.value)
def change_text():
with rc:
text.value = "Should never be rendered visible"
text.value = "Updated text"
solara.Button("Change text", on_click=change_text)
solara.Text(text.value) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have
and in my component, I have
... def add_workflow(pk: int | None = None): wizard_models.set( [ *wizard_models.value, solara.reactive(QeWizardModel(pk=pk)), ], ) data_models.set( [ *data_models.value, solara.reactive(QeDataModel(pk=pk)), ], ) active.set(len(data_models.value) - 1) ...On adding a workflow, both reactive variables trigger a re-render each. Does Solara or Reacton have a batching mechanism?
Beta Was this translation helpful? Give feedback.
All reactions