UNPKG

reactotron-react-native

Version:

A development tool to explore, inspect, and diagnose your React Native apps.

46 lines (43 loc) 944 B
"use strict"; import React, { Component } from "react"; import { View } from "react-native"; import { jsx as _jsx } from "react/jsx-runtime"; class StorybookSwitcher extends Component { /** * Creates an instance of FullScreenOverlay. * * @memberOf FullScreenOverlay */ constructor(props) { super(props); this.state = { showStorybook: false }; // when the server sends stuff props.emitter.on("storybook", payload => { this.setState({ showStorybook: payload }); }); } /** * Draw. */ render() { const { showStorybook } = this.state; const { storybookUi: StorybookUi, children } = this.props; return /*#__PURE__*/_jsx(View, { style: { flex: 1 }, children: showStorybook ? /*#__PURE__*/_jsx(StorybookUi, {}) : children }); } } export default StorybookSwitcher; //# sourceMappingURL=storybook.js.map