Storybook: Allow changing backgroundColor of stories

Created on 15 May 2017  路  2Comments  路  Source: storybookjs/storybook

Can I change the backgroundColor of all stories in React Native?

I'm using rn-splash-screen to show a splash screen, the problem is that it modifies the background of react native

react-native feature request

Most helpful comment

Hey, currently there is no way to do that. The styles are defined here:
https://github.com/storybooks/storybook/blob/master/app/react-native/src/preview/components/StoryView/style.js

Maybe you can think of a way how to change the styles?

All 2 comments

Hey, currently there is no way to do that. The styles are defined here:
https://github.com/storybooks/storybook/blob/master/app/react-native/src/preview/components/StoryView/style.js

Maybe you can think of a way how to change the styles?

To have Storybook to work with rn-splash-screen you need to hide the splash screen during the Storybook initialization.

Example:

import { AppRegistry } from 'react-native';
import { getStorybookUI, configure } from '@storybook/react-native';
import SplashScreen from 'rn-splash-screen';

// import stories
configure(() => {
  require('./stories');
}, module);

SplashScreen.hide();
const StorybookUI = getStorybookUI({ port: 7007, host: 'localhost' });
AppRegistry.registerComponent('Bexco', () => StorybookUI);
export default StorybookUI;
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZigGreen picture ZigGreen  路  3Comments

sakulstra picture sakulstra  路  3Comments

shilman picture shilman  路  3Comments

levithomason picture levithomason  路  3Comments

tlrobinson picture tlrobinson  路  3Comments