Describe the bug
While working on the internship assessment, I noticed that updating one component’s state (like a checkbox) causes all components to re-render, including heavy ones like tables. This leads to unnecessary performance hits and noticeable UI lag for large components.
The should_render function in utils.py (called in render_tracking.py) is being called twice per component, and the hash-based comparison is not working as expected.
Specifically:
- The code stores a hash of the old component data.
- But when comparing, it does not hash the new data — instead, it compares raw cleaned values, which causes
has_changed to return True even when values are the same.
- Also, after each update, the
state_cache does not retain updated state, which breaks comparison in the next render.
To Reproduce
Steps to reproduce the behavior:
- Create a
hello.py file with a table and a checkbox that displays a text.
- Go to
utils.py and find the has_changed function.
- Log
old_clean and new_clean.
- Observe the output after toggling the checkbox.
Expected behavior
has_changed should be called once per component, not twice.
- If a component hasn’t changed,
old_clean and new_clean should be equal.
should_render should return False if values are identical.
Screenshots
Below, I modified the code to compare the hash of both old and new values, exposing the issue of should_render always returning True:

Environment:
- OS: macOS
- Browser: Chrome
- Version: 137
Additional context
In render_tracking.py, I attempted the following change to avoid double invocation of should_render:
from this
component['shouldRender'] = service.should_render(component_id, component)
# Append component only if changed
if service.should_render(component_id, component):
to this
component['shouldRender'] = service.should_render(component_id, component)
# Append component only if changed
if component['shouldRender']:
still the issue is there
Describe the bug
While working on the internship assessment, I noticed that updating one component’s state (like a checkbox) causes all components to re-render, including heavy ones like tables. This leads to unnecessary performance hits and noticeable UI lag for large components.
The
should_renderfunction inutils.py(called inrender_tracking.py) is being called twice per component, and the hash-based comparison is not working as expected.Specifically:
has_changedto returnTrueeven when values are the same.state_cachedoes not retain updated state, which breaks comparison in the next render.To Reproduce
Steps to reproduce the behavior:
hello.pyfile with a table and a checkbox that displays a text.utils.pyand find thehas_changedfunction.old_cleanandnew_clean.Expected behavior
has_changedshould be called once per component, not twice.old_cleanandnew_cleanshould be equal.should_rendershould returnFalseif values are identical.Screenshots
Below, I modified the code to compare the hash of both old and new values, exposing the issue of
should_renderalways returningTrue:Environment:
Additional context
In
render_tracking.py, I attempted the following change to avoid double invocation ofshould_render:from this
to this
still the issue is there