@remotion/studio: Fix JSON editor error state being immediately cleared#6956
Merged
JonnyBurger merged 1 commit intomainfrom Apr 1, 2026
Merged
@remotion/studio: Fix JSON editor error state being immediately cleared#6956JonnyBurger merged 1 commit intomainfrom
@remotion/studio: Fix JSON editor error state being immediately cleared#6956JonnyBurger merged 1 commit intomainfrom
Conversation
…ared Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Reviewed PR #6956 — approved. The fix correctly eliminates the feedback loop by switching to a functional state updater, removing Task list (4/4 completed)
|
Contributor
There was a problem hiding this comment.
Clean fix. The localValue dependency was causing the useEffect to re-fire on every local state change — including invalid JSON input — which overwrote the error state with the parent's stale good value. The functional updater correctly removes localValue from the dependency array while still accessing previous state for the deepEqual guard.
Big Pickle (free) | 𝕏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
localValuefrom theuseEffectdependency array inRenderModalJSONPropsEditoruseEffectthat syncs local state with the parentvaluehadlocalValueas a dependency, causing a feedback loop: typing invalid JSON would trigger the effect, which would overwrite the error state with the parent's last-known-good valuesetLocalValue((prev) => ...)) to access previous state without needinglocalValueas a dependencyTest plan
json-editor.test.mtse2e tests pass consistently (no longer flaky)🤖 Generated with Claude Code