react-native-multiple-modals
Version:
Native implementation with the ability to display multiple Modals
25 lines (22 loc) • 860 B
JavaScript
;
import { useContext } from 'react';
import AppContainer from 'react-native/Libraries/ReactNative/AppContainer';
import { RootTagContext } from 'react-native/Libraries/ReactNative/RootTag';
// Wrap the children in AppContainer so the React Native inspector works
// within the modal. See https://github.com/facebook/react-native/blob/v0.81.4/packages/react-native/Libraries/Modal/Modal.js#L308
// for the inspiration within the RN Modal component.
import { jsx as _jsx } from "react/jsx-runtime";
export const LayoutInspectorProvider = ({
children
}) => {
const rootTag = useContext(RootTagContext);
// The inspector is only needed in development
if (!__DEV__) {
return children;
}
return /*#__PURE__*/_jsx(AppContainer, {
rootTag: rootTag,
children: children
});
};
//# sourceMappingURL=LayoutInspectorProvider.js.map