From a9f6b16943bf25c33e85b9735c1be2955e415537 Mon Sep 17 00:00:00 2001 From: elliotsayes Date: Fri, 9 Sep 2022 12:26:36 +1200 Subject: [PATCH] Update Readme Cleaner conditional require (reduces bundle size?). Also conditionally enable devTools. --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 25484d7..b25f33a 100644 --- a/README.md +++ b/README.md @@ -20,17 +20,15 @@ $ yarn add react-native-flipper-xstate To use, simply import and call the `inspect` function at the root of your project (index.js) You will only want to do this in Debug/Dev builds. ```js -import { inspect } from "react-native-flipper-xstate"; - if (__DEV__) { - inspect(); + require("react-native-flipper-xstate").inspect(); } ``` You also must specify the `devTools` option when creating your machines. Here is an example using the `useMachine` hook. ```js -const [current, send] = createMachine(machine, { devTools: true }); +const [current, send] = createMachine(machine, { devTools: __DEV__ }); ``` ## Todo