mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 02:31:49 +08:00
Merge branch 'master' into derekstavis-patch-2
This commit is contained in:
commit
d75fd44797
@ -1,4 +1,5 @@
|
|||||||
import { AppRegistry } from 'react-native';
|
import { AppRegistry } from 'react-native';
|
||||||
|
import React, { Component } from 'react';
|
||||||
import { getStorybookUI, configure } from '@storybook/react-native';
|
import { getStorybookUI, configure } from '@storybook/react-native';
|
||||||
import { setOptions } from '@storybook/addon-options';
|
import { setOptions } from '@storybook/addon-options';
|
||||||
|
|
||||||
@ -8,10 +9,7 @@ configure(() => {
|
|||||||
require('./stories');
|
require('./stories');
|
||||||
}, module);
|
}, module);
|
||||||
|
|
||||||
const StorybookUI = getStorybookUI({
|
const StorybookUIRoot = getStorybookUI({ port: 7007, onDeviceUI: true });
|
||||||
port: 7007,
|
|
||||||
onDeviceUI: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() =>
|
() =>
|
||||||
@ -21,6 +19,13 @@ setTimeout(
|
|||||||
100
|
100
|
||||||
);
|
);
|
||||||
|
|
||||||
AppRegistry.registerComponent('ReactNativeVanilla', () => StorybookUI);
|
// react-native hot module loader must take in a Class - https://github.com/facebook/react-native/issues/10991
|
||||||
|
// eslint-disable-next-line react/prefer-stateless-function
|
||||||
|
class StorybookUIHMRRoot extends Component {
|
||||||
|
render() {
|
||||||
|
return <StorybookUIRoot />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export { StorybookUI as default };
|
AppRegistry.registerComponent('ReactNativeVanilla', () => StorybookUIHMRRoot);
|
||||||
|
export default StorybookUIHMRRoot;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable global-require */
|
/* eslint-disable global-require */
|
||||||
|
import React, { Component } from 'react';
|
||||||
import { AppRegistry } from 'react-native';
|
import { AppRegistry } from 'react-native';
|
||||||
import { getStorybookUI, configure } from '@storybook/react-native';
|
import { getStorybookUI, configure } from '@storybook/react-native';
|
||||||
|
|
||||||
@ -10,6 +10,16 @@ configure(() => {
|
|||||||
|
|
||||||
// This assumes that storybook is running on the same host as your RN packager,
|
// This assumes that storybook is running on the same host as your RN packager,
|
||||||
// to set manually use, e.g. host: 'localhost' option
|
// to set manually use, e.g. host: 'localhost' option
|
||||||
const StorybookUI = getStorybookUI({ port: 7007, onDeviceUI: true });
|
const StorybookUIRoot = getStorybookUI({ port: 7007, onDeviceUI: true });
|
||||||
AppRegistry.registerComponent('%APP_NAME%', () => StorybookUI);
|
|
||||||
export default StorybookUI;
|
// react-native hot module loader must take in a Class - https://github.com/facebook/react-native/issues/10991
|
||||||
|
// https://github.com/storybooks/storybook/issues/2081
|
||||||
|
// eslint-disable-next-line react/prefer-stateless-function
|
||||||
|
class StorybookUIHMRRoot extends Component {
|
||||||
|
render() {
|
||||||
|
return <StorybookUIRoot />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AppRegistry.registerComponent('%APP_NAME%', () => StorybookUIHMRRoot);
|
||||||
|
export default StorybookUIHMRRoot;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user