mirror of
https://github.com/morten-olsen/react-native-debug-console.git
synced 2026-02-08 00:36:26 +01:00
Updated readme
This commit is contained in:
39
README.md
39
README.md
@@ -1,8 +1,10 @@
|
|||||||
# React Native Debug Console
|
# React Native Debug Console
|
||||||
|
|
||||||
A network and console debug component and modal for `react native` purely in JavaScript
|
... and yes I am aware that it is a boring name
|
||||||
|
|
||||||
[[demo]](https://expo.io/@mortenolsen/demo) [[snack]](https://snack.expo.io/@mortenolsen/react-native-debug-console)
|
React Native Debug Console is an easy to use network and console debug component and modal for react native, written purely in JavaScript
|
||||||
|
|
||||||
|
[[demo]](https://expo.io/@mortenolsen/demo)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -14,20 +16,28 @@ npm install react-native-debug-console
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
It comes as a ready to use modal, as well as a standalone component
|
In order to redirect console logs and network logs to the console, these has to be attached
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import {
|
import {
|
||||||
|
DevTool,
|
||||||
DevToolModal,
|
DevToolModal,
|
||||||
log,
|
log,
|
||||||
network,
|
network,
|
||||||
show,
|
|
||||||
} from 'react-native-debug-console';
|
} from 'react-native-debug-console';
|
||||||
|
|
||||||
network.attach();
|
network.attach();
|
||||||
log.attach();
|
log.attach();
|
||||||
|
|
||||||
const App = () => (
|
```
|
||||||
|
|
||||||
|
Be aware that this stops logs to be output to the regular console.
|
||||||
|
If that is needed, attach it as `log.attach(true)`
|
||||||
|
|
||||||
|
`react-native-debug-console` can be used either as a modal, or as a standard component, which can be placed anywhere in you application
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const AppWithModal = () => (
|
||||||
<View>
|
<View>
|
||||||
<MyOtherContent />
|
<MyOtherContent />
|
||||||
<DevToolModal />
|
<DevToolModal />
|
||||||
@@ -35,23 +45,14 @@ const App = () => (
|
|||||||
onPress={show}
|
onPress={show}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
)
|
);
|
||||||
```
|
|
||||||
|
|
||||||
```javascript
|
const AppWithComponent = () => (
|
||||||
import {
|
|
||||||
DevTool,
|
|
||||||
log,
|
|
||||||
network,
|
|
||||||
} from 'react-native-debug-console';
|
|
||||||
|
|
||||||
network.attach();
|
|
||||||
log.attach();
|
|
||||||
|
|
||||||
const App = () => (
|
|
||||||
<View>
|
<View>
|
||||||
<MyOtherContent />
|
<MyOtherContent />
|
||||||
<DevTool />
|
<DevTool />
|
||||||
</View>
|
</View>
|
||||||
)
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Both `DevTool` and `DevToolModal` has a `includeStackTrace` property, which if set will print the stack trace on errors, not just the error message. `<DevTool includeStackTrace />`
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-debug-console",
|
"name": "react-native-debug-console",
|
||||||
"version": "1.0.0-beta.7",
|
"version": "1.0.0-beta.8",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
"name": "debugger",
|
"name": "debugger",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
"repository": {
|
||||||
|
"url": "https://github.com/morten-olsen/react-native-debugger",
|
||||||
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"create-react-native-app": "^1.0.0",
|
"create-react-native-app": "^1.0.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user