Pin @storybook/react-native peer dep and document internal API usage#81
Open
EmilioBejasa wants to merge 9 commits intomainfrom
Open
Pin @storybook/react-native peer dep and document internal API usage#81EmilioBejasa wants to merge 9 commits intomainfrom
EmilioBejasa wants to merge 9 commits intomainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…chris-workspace Had to merge code from PRs #58 and 61.
Narrow peerDependency from "*" to ">=10.0.0 <11.0.0" — the View class internals we depend on (_storyIndex, _idToPrepared, _preview) are not part of a public API contract, so accepting any version silently risks breakage. Add a comment explaining why we use these internals and that there is currently no public alternative. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tdrhq
requested changes
Mar 18, 2026
Contributor
tdrhq
left a comment
There was a problem hiding this comment.
Your job building this library will be to do if-else conditions to make sure it works for every React Native version. It's okay to set a minimum supported version.
You'll need some kind of test to ensure that it works for every version
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
peerDependenciesfor@storybook/react-nativefrom"*"to">=10.0.0 <11.0.0"StoryRenderer.tsxexplaining why we use internalViewAPIs (_storyIndex,_idToPrepared,_preview) and that there is currently no public alternativeWhy
The
Viewclass in@storybook/react-nativedoesn't expose a public API for programmatic story rendering — every property we need is underscore-prefixed (internal). Accepting"*"as the peer dependency means a consumer on a future major version could install the package and get silent breakage. Pinning to^10prevents this and makes the constraint visible.Test plan
npm installwarns correctly if a consumer has a different major version of Storybook🤖 Generated with Claude Code