Skip to content

Commit

Permalink
Merge pull request #25678 from storybookjs/shilman/rn8
Browse files Browse the repository at this point in the history
React-Native: Fixes for v8 compatibility
  • Loading branch information
shilman authored Jan 26, 2024
2 parents 311de8e + 283b495 commit 806cbdd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/lib/manager-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"react-native": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/lib/preview-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"react-native": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
2 changes: 1 addition & 1 deletion code/lib/preview-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ export type { PropDescriptor } from './store';
* STORIES API
*/
export { StoryStore } from './store';
export { Preview, PreviewWeb } from './preview-web';
export { Preview, PreviewWithSelection, PreviewWeb } from './preview-web';
7 changes: 7 additions & 0 deletions code/lib/preview-api/src/modules/preview-web/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,13 @@ export class Preview<TRenderer extends Renderer> {
return this.storyStoreValue.loadStory({ storyId });
}

getStoryContext(story: PreparedStory<TRenderer>, { forceInitialArgs = false } = {}) {
if (!this.storyStoreValue)
throw new CalledPreviewMethodBeforeInitializationError({ methodName: 'getStoryContext' });

return this.storyStoreValue.getStoryContext(story, { forceInitialArgs });
}

async extract(options?: { includeDocsOnly: boolean }) {
if (!this.storyStoreValue)
throw new CalledPreviewMethodBeforeInitializationError({ methodName: 'extract' });
Expand Down

0 comments on commit 806cbdd

Please sign in to comment.