Skip to content

chromaui-demo/react-native-screenshots

Repository files navigation

image

Taking image snapshots of Storybook

Screenshotting your RN app requires a few steps:

  1. Start the web version of Storybook. You should see the string "websocket connection established".
npm run storybook:web
  1. After the web version is running, start the RN version with EXPO_PUBLIC_STORYBOOK_SNAPSHOT=1. EXPO_PUBLIC_STORYBOOK_SNAPSHOT removes Storybook's UI for cleaner screenshots.
EXPO_PUBLIC_STORYBOOK_SNAPSHOT=1 npm run storybook:ios
  1. After the RN version is running, run the snapshot tool, which will loop over the stories and save them into the screenshots directory.
npm run snapshot-storybook