Skip to main content

Setup

Set up Sherlo in your React Native project by installing the SDK, updating your Metro config, and giving Sherlo access to Storybook.

Quick start

New to Sherlo? Run this instead of manual integration:

Terminal
npx sherlo init

Learn more

Check the minimum versions​

To use Sherlo, ensure the following packages are installed:

Install the Sherlo SDK​

To install Sherlo, run:

Terminal
npm install @sherlo/react-native-storybook
Native modules

If your project has iOS native code, run:

  1. cd ios - to switch to the folder
  2. pod install - to install the iOS dependencies

Update your Metro config​

To enable Sherlo to control Storybook during testing, update your Metro config:

metro.config.js
const path = require("path");
const { getDefaultConfig } = require("@expo/metro-config");
const withStorybook = require("@storybook/react-native/metro/withStorybook");
const withStorybook = require("@sherlo/react-native-storybook/metro/withStorybook");

const defaultConfig = getDefaultConfig(__dirname);

module.exports = withStorybook(defaultConfig);

Give Sherlo access to Storybook​

To enable Sherlo to access Storybook, choose one of these options:

Provide a build that opens straight into Storybook.

Root component
import Storybook from "./.rnstorybook";

export default function App() {
return <Storybook />;
}

No app, no menu - Storybook only.