diff options
author | Thomas F. K. Jorna <[email protected]> | 2021-07-14 15:10:31 +0200 |
---|---|---|
committer | Thomas F. K. Jorna <[email protected]> | 2021-07-14 15:10:31 +0200 |
commit | e5021187e96b78b53203bd95d08d6818aea47d17 (patch) | |
tree | 37ec45d00eb963db53cd4bb4f04a770414b351cc /storybook/storybook.tsx |
New Ignite 7.0.6 app
Diffstat (limited to 'storybook/storybook.tsx')
-rw-r--r-- | storybook/storybook.tsx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/storybook/storybook.tsx b/storybook/storybook.tsx new file mode 100644 index 0000000..0479d4e --- /dev/null +++ b/storybook/storybook.tsx @@ -0,0 +1,31 @@ +import React, { useEffect } from "react" +import { getStorybookUI, configure } from "@storybook/react-native" +import { initFonts } from "../app/theme/fonts" + +declare let module + +configure(() => { + require("./storybook-registry") +}, module) + +const StorybookUI = getStorybookUI({ + port: 9001, + host: "localhost", + onDeviceUI: true, + asyncStorage: require("@react-native-async-storage/async-storage").default || null, +}) + +export function StorybookUIRoot() { + useEffect(() => { + ;(async () => { + await initFonts() // expo only + if (typeof __TEST__ === "undefined" || !__TEST__) { + const Reactotron = require("../app/services/reactotron") + const reactotron = new Reactotron.Reactotron() + reactotron.setup() + } + })() + }, []) + + return <StorybookUI /> +} |