Skip to main content

🛠️ Setup

Requirements

To use Sherlo, ensure the following packages are installed:

Install Sherlo

To install Sherlo, run:

npm install -D @sherlo/react-native-storybook
Native Modules

Sherlo adds native modules. If you are not using Expo, run:

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

Storybook Component

To enable Sherlo interaction with Storybook, update the Storybook component

info

Storybook component is typically exported from .storybook config directory at your project root

.storybook/index.js
import AsyncStorage from "@react-native-async-storage/async-storage";
import { getStorybook } from "@sherlo/react-native-storybook";
import { view } from "./storybook.requires";

const Storybook = view.getStorybookUI({
const Storybook = getStorybook(view, {
storage: {
getItem: AsyncStorage.getItem,
setItem: AsyncStorage.setItem,
},
});

export default Storybook;

Storybook Entry Point

To provide Storybook access to Sherlo, use one of the following methods:

If you can make a build that renders Storybook on launch, that's all we need

You can skip this step