Skip to main content

Redux Devtools

Rematch works with Redux Devtools out of the box. No configuration required.

ts
import { init } from "@rematch/core";
init(); // devtools up and running
ts
import { init } from "@rematch/core";
init(); // devtools up and running

Its also possible to add redux devtools configuration options.

ts
import { init } from "@rematch/core";
 
init({
redux: {
devtoolOptions: {
actionSanitizer: (action) => action,
},
},
});
ts
import { init } from "@rematch/core";
 
init({
redux: {
devtoolOptions: {
actionSanitizer: (action) => action,
},
},
});

To disable redux devtools, set disabled property to true:

ts
import { init } from "@rematch/core";
 
init({
redux: {
devtoolOptions: {
disabled: true,
},
},
});
ts
import { init } from "@rematch/core";
 
init({
redux: {
devtoolOptions: {
disabled: true,
},
},
});

Remote Redux-Devtools#

Remote-redux-devtools is not supported in rematch see this issue. You can use react-native-debugger which works out of the box with rematch.

Reactotron#

Setup Rematch to also work with Reactotron devtools.

Reactotron.config.js
ts
import Reactotron from "reactotron-react-native";
import { reactotronRedux } from "reactotron-redux";
 
export default Reactotron.configure({
name: "MyAwesomeApp",
})
.use(reactotronRedux())
// add other devtools here
.connect();
Reactotron.config.js
ts
import Reactotron from "reactotron-react-native";
import { reactotronRedux } from "reactotron-redux";
 
export default Reactotron.configure({
name: "MyAwesomeApp",
})
.use(reactotronRedux())
// add other devtools here
.connect();

Overwrite createStore to complete the config.

store.ts
ts
import { init } from "@rematch/core";
import Reactotron from "./Reactotron.config.js";
 
init({
redux: {
enhancers: [Reactotron.createEnhancer()],
// If using typescript/flow, enhancers: [Reactotron.createEnhancer!()]
},
});
store.ts
ts
import { init } from "@rematch/core";
import Reactotron from "./Reactotron.config.js";
 
init({
redux: {
enhancers: [Reactotron.createEnhancer()],
// If using typescript/flow, enhancers: [Reactotron.createEnhancer!()]
},
});