mirror of
https://github.com/morten-olsen/react-native-debug-console.git
synced 2026-02-08 00:36:26 +01:00
57 lines
816 B
Markdown
57 lines
816 B
Markdown
# React Native Debug Console
|
|
|
|
A network and console debug component and modal for `react native` purely in JavaScript
|
|
|
|
[[demo]](https://expo.io/@mortenolsen/demo)
|
|
|
|

|
|
|
|
## Installation
|
|
|
|
```
|
|
npm install react-native-debug-console
|
|
```
|
|
|
|
## Usage
|
|
|
|
It comes as a ready to use modal, as well as a standalone component
|
|
|
|
```javascript
|
|
import {
|
|
DevToolModal,
|
|
log,
|
|
network,
|
|
show,
|
|
} from 'react-native-debug-console';
|
|
|
|
network.attach();
|
|
log.attach();
|
|
|
|
const App = () => (
|
|
<View>
|
|
<MyOtherContent />
|
|
<DevToolModal />
|
|
<Button
|
|
onPress={show}
|
|
/>
|
|
</View>
|
|
)
|
|
```
|
|
|
|
```javascript
|
|
import {
|
|
DevTool,
|
|
log,
|
|
network,
|
|
} from 'react-native-debug-console';
|
|
|
|
network.attach();
|
|
log.attach();
|
|
|
|
const App = () => (
|
|
<View>
|
|
<MyOtherContent />
|
|
<DevTool />
|
|
</View>
|
|
)
|
|
``` |