@storybook/react-native
Version:
A better way to develop React Native Components for your app
50 lines (40 loc) • 1.23 kB
text/typescript
/* do not change this file, it is auto generated by storybook. */
import { start, updateView } from '@storybook/react-native';
import '@storybook/addon-ondevice-controls/register';
import '@storybook/addon-ondevice-actions/register';
const normalizedStories = [
{
titlePrefix: '',
directory: './.rnstorybook/stories',
files: '**/*.stories.?(ts|tsx|js|jsx)',
importPathMatcher:
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
// @ts-ignore
req: require.context(
'./stories',
true,
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/
),
},
];
declare global {
var view: ReturnType<typeof start>;
var STORIES: typeof normalizedStories;
}
const annotations = [
require('./preview'),
require('@storybook/react-native/dist/preview'),
require('@storybook/addon-ondevice-actions/preview'),
];
global.STORIES = normalizedStories;
// @ts-ignore
module?.hot?.accept?.();
if (!global.view) {
global.view = start({
annotations,
storyEntries: normalizedStories,
});
} else {
updateView(global.view, annotations, normalizedStories);
}
export const view = global.view;