useBeagle hook provides a simple interface to control the Beagle inspector from your components.
Return Value
The hook returns an object with the following property:Opens the Beagle inspector modal, displaying all captured logs.
Learn more about Mintlify
Enter your email to receive updates about new features and product releases.
Hook for accessing the Beagle inspector controls
useBeagle hook provides a simple interface to control the Beagle inspector from your components.
import { useBeagle } from 'react-native-beagle';
import { View, Button } from 'react-native';
function DebugPanel() {
const { showInspector } = useBeagle();
return (
<View>
<Button
title="Open Inspector"
onPress={showInspector}
/>
</View>
);
}
import { useBeagle } from 'react-native-beagle';
import { TouchableOpacity, Text } from 'react-native';
function FloatingDebugButton() {
const { showInspector } = useBeagle();
return (
<TouchableOpacity
onPress={showInspector}
style={{
position: 'absolute',
bottom: 20,
right: 20,
backgroundColor: '#FF6B35',
padding: 15,
borderRadius: 30,
}}
>
<Text style={{ color: 'white', fontWeight: 'bold' }}>
Beagle
</Text>
</TouchableOpacity>
);
}
import { useBeagle } from 'react-native-beagle';
import { Button } from 'react-native';
function DevToolsButton() {
const { showInspector } = useBeagle();
if (!__DEV__) {
return null;
}
return (
<Button
title="Debug"
onPress={showInspector}
/>
);
}
function useBeagle(): {
showInspector: () => void;
}