reactotron-react-native
Version:
A development tool to explore, inspect, and diagnose your React Native apps.
35 lines (34 loc) • 977 B
JavaScript
;
import React from "react";
import { View } from "react-native";
import mitt from "mitt";
import FullScreenOverlay from "./overlay.js";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export default function OverlayCreator() {
return function overlay() {
const emitter = mitt();
return {
/**
* Fires when any Reactotron message arrives.
*/
onCommand: command => {
if (command.type !== "overlay") return;
// relay this payload on to the emitter
emitter.emit("overlay", command.payload);
},
features: {
overlay: WrappedComponent => (props = {}) => /*#__PURE__*/_jsxs(View, {
style: {
flex: 1
},
children: [/*#__PURE__*/_jsx(WrappedComponent, {
...props
}), /*#__PURE__*/_jsx(FullScreenOverlay, {
emitter: emitter
})]
})
}
};
};
}
//# sourceMappingURL=index.js.map