react-native-bundle-inspector
v0.1.2
Published
react-native-bundle-inspector
Readme
react-native-bundle-inspector
react-native-bundle-inspector
Installation
npm install react-native-bundle-inspectorUsage
import { useRef, useEffect } from 'react';
import { Text, View, type EventSubscription } from 'react-native';
import BundleInspector, {
inspectorDispatchedSubscribe,
inspectorToggle,
} from 'react-native-bundle-inspector';
export default function App() {
const parentSubscription = useRef<null | EventSubscription>(null);
useEffect(() => {
inspectorToggle('containerId', true);
parentSubscription.current = inspectorDispatchedSubscribe(
'containerId',
(containerId, data) => {
console.log(`Result: ${data}`);
}
);
return () => {
parentSubscription.current?.remove();
parentSubscription.current = null;
};
}, []);
return (
<BundleInspector containerId="containerId">
<View>
<Text>asd</Text>
</View>
</BundleInspector>
);
}