Single surface + loadStory for screenshot loop#93
Draft
EmilioBejasa wants to merge 2 commits intomainfrom
Draft
Conversation
Instead of remounting a fresh ReactSurface for every story, keep one surface alive for the entire test run. After the bootstrap render populates the story manifest and _idToPrepared, each story is switched by emitting a loadStory event from the main thread and waiting on a CountDownLatch that notifyStoryReady() releases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getJSModule(RCTDeviceEventEmitter) is a bridge-era API that returns null in bridgeless/new-arch mode, silently dropping the event. emitDeviceEvent is the current API used by RN's own DeviceEventManagerModule internals. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
ReactSurfacefor the entire test run instead of remounting per story_idToPrepared, switch stories vialoadStory()events fired on the main threadloadStoryemission: replacegetJSModule(RCTDeviceEventEmitter)(bridge-era API, returns null in bridgeless/new-arch) withreactApplicationContext.emitDeviceEvent(), which is what RN's own internals useTest plan
🤖 Generated with Claude Code