|
1 | 1 | # Configuration
|
2 | 2 |
|
3 |
| -TODO: Document all the good stuff about configuration here |
| 3 | +When calling Reacotrons `configure` method you can pass options. |
| 4 | + |
| 5 | +```javascript |
| 6 | +import Reactotron from 'reactotron-react-native' // or 'reactotron-react-js' |
| 7 | + |
| 8 | +Reactotron.configure({ |
| 9 | + createStocket: () => {}, // TODO: Document |
| 10 | + host: '10.0.0.1', // TODO: Document |
| 11 | + port: 9090, // TODO: Document |
| 12 | + name: 'My Awesome App', // TODO: Document |
| 13 | + secure: true, // TODO: Document. Do we need to? |
| 14 | + onCommand: () => {}, // TODO: Document |
| 15 | + onConnect: () => {}, // TODO: Document |
| 16 | + onDisconnect: () => {}, // TODO: Document |
| 17 | + setClientId: () => {}, // TODO: Document |
| 18 | + getClientId: () => {}, // TODO: Document |
| 19 | +}) |
| 20 | +``` |
| 21 | + |
| 22 | +TODO: Document `use`. |
| 23 | + |
| 24 | +```javascript |
| 25 | +Reactotron.use((reactotron) => { |
| 26 | + // You get access to the reactotron instance so you can attach event listeners |
| 27 | + // so you can react to events coming through reactotron or event transmit your own events. |
| 28 | +}) |
| 29 | +``` |
4 | 30 |
|
5 | 31 | TODO: Document all the good things about .useReactNative here!
|
| 32 | +```javascript |
| 33 | +Reactotron.useReactNative({ |
| 34 | + // Global Error Tracking |
| 35 | + // errors: false, // Passing false turns off this plugin |
| 36 | + // errors: true, // Turn it on but don't care about the options |
| 37 | + errors: { // Turn it on with some options |
| 38 | + veto: (frame) => { return false; } |
| 39 | + }, |
| 40 | + |
| 41 | + // Open in editor |
| 42 | + editor: { |
| 43 | + url: 'http://localhost:8081' // URL to the react native metro bundler |
| 44 | + }, |
| 45 | + |
| 46 | + // React Native Overlay |
| 47 | + overlay: true, // No options, just true or false. |
| 48 | + |
| 49 | + // React Native Async Storage |
| 50 | + asyncStorage: { |
| 51 | + ignore: ['keys', 'to', 'ignore'] // An array of async storage keys to not track |
| 52 | + }, |
| 53 | + |
| 54 | + // React Native Network Tracking |
| 55 | + networking: { |
| 56 | + ignoreContentTypes: /[a-z]/g, // Regex to ignore certain content types |
| 57 | + ignoreUrls: /[a-z]/g, // Regex to ignore certain urls |
| 58 | + }, |
| 59 | + |
| 60 | + // React Native storybook support |
| 61 | + storybook: true, // No options, just true or false. |
| 62 | + |
| 63 | + // React Native dev tools support |
| 64 | + devTools: true, // No options, just true or false. |
| 65 | +}) |
| 66 | +``` |
0 commit comments