Skip to main content

๐Ÿ› ๏ธ Setup

๐Ÿš€ Quick Start

New to Sherlo? Run this instead of manual integration:

Terminal
npx sherlo init

Learn more โ†’

Requirementsโ€‹

To use Sherlo, ensure the following packages are installed:

Dependenciesโ€‹

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 navigate to the folder
  2. pod install - to install the iOS dependencies

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);

Storybook Accessโ€‹

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