start()
Initializes the Storybook runtime and returns aView instance that can be used to render the Storybook UI.
Signature
Parameters
Array of preview annotations (configurations, decorators, parameters) from your
.storybook/preview.tsx or other preview files.Array of story specifiers with their corresponding require contexts. This is typically generated by the Metro or Webpack bundler.
Optional React Native-specific configuration.
Returns
A View instance that manages the Storybook UI and story rendering. Call
getStorybookUI() on this instance to get the React component.Example
.storybook/index.tsx
prepareStories()
Processes story entries and creates a story index with an import map. This is typically called internally bystart() but can be used for advanced use cases.
Signature
Parameters
Array of story specifiers with their corresponding require contexts.
React Native-specific configuration options.
Function or configuration object for sorting stories in the navigation.
Returns
The generated story index containing all discovered stories with their metadata.
Map of import paths to their story exports, used for lazy loading stories.
Example
getProjectAnnotations()
Creates a function that composes project annotations (render functions, decorators, parameters) for the Storybook instance.Signature
Parameters
The View instance managing the Storybook UI.
Array of preview annotations to compose.
Returns
An async function that returns the composed project annotations including the default React Native render function.
Example
updateView()
Updates an existing View instance with new annotations or story entries. Useful for hot module replacement or dynamic story updates.Signature
Parameters
The existing View instance to update.
New array of preview annotations.
Updated array of story specifiers.
React Native-specific configuration options.
Example
See Also
- View Configuration - Configure the View instance returned by
start() - StorybookConfig - Main configuration interface