redux-flipper is a Redux middleware designed to integrate Redux state and action debugging directly with the Flipper desktop client. It works in conjunction with the `flipper-plugin-redux-debugger` to visualize Redux store changes in real-time within React Native applications. The current stable version is 2.0.3, which supports Redux v5 and has relaxed peer dependency requirements for `react-native-flipper` and `react-native`. The package generally follows the release cadence of its companion Flipper plugin. Key differentiators include its ability to whitelist or blacklist specific state keys and actions, resolve cyclic references in the state (though with a performance warning), and its straightforward integration process for React Native applications, particularly those using `react-native` >= 0.62.
npm install redux-flipperVerified import paths — ran on the pinned version, not inferred.
This code demonstrates how to integrate `redux-flipper` middleware into both a traditional Redux store and a Redux Toolkit store, including common configuration options for state whitelisting/blacklisting and conditional `__DEV__` inclusion.
Update `flipper-plugin-redux-debugger` to version 2.0.0 or later in your Flipper desktop client (`Manage Plugins > Install Plugins`).
Avoid cyclic references in your Redux state. If strictly necessary, use `createDebugger({ resolveCyclic: true })` but monitor performance. Prefer `stateWhitelist` to reduce the amount of state being serialized.Wrap the `createDebugger()` middleware instantiation and addition to your middleware array within an `if (__DEV__) { ... }` block to ensure it's only active in development builds. Example: `if (__DEV__) { middlewares.push(createDebugger()); }`Refer to the official Flipper documentation for manual setup steps for React Native versions below 0.62: `https://fbflipper.com/docs/getting-started/react-native.html#manual-setup`.
1. Ensure `flipper-plugin-redux-debugger` is installed and enabled in your Flipper desktop client via `Manage Plugins > Install Plugins`. 2. Verify your React Native app is connected to Flipper. 3. Check that `redux-flipper` middleware is correctly applied to your Redux store, preferably within an `if (__DEV__)` block.
When using CommonJS `require`, ensure you access the default export with `.default`: `const createDebugger = require('redux-flipper').default;`. If using ESM, `import createDebugger from 'redux-flipper';` is the correct syntax.Either refactor your Redux state to eliminate cyclic references, or enable the `resolveCyclic` option as a temporary measure: `createDebugger({ resolveCyclic: true })`. Be aware of potential performance impacts when enabling `resolveCyclic`. Consider using `stateWhitelist` to only debug specific parts of the state.