Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.98 KB

MIDDLEWARE.md

File metadata and controls

62 lines (46 loc) · 1.98 KB

<- to the main page

Adding middleware and DevTools

thunk is already included, no need to add it.

Redux DevTools is also included, but you can turn it off by calling useDevTools.

// app.jsx

import React from 'react'
import { Provider, useDevTools } from 'master-hook'

useDevTools(false)

export const App = () => (
  <Provider>
    // Your app code is here
  </Provider>
)

Make sure to do it BEFORE calling 'Provider'

To add more middleware, use addMiddleware.

// app.jsx

import React from 'react'
import { Provider, addMiddleware } from 'master-hook'

addMiddleware(['list of your middlewares'])

export const App = ({children}) => (
  <Provider>
    {children}
  </Provider>
)

Make sure to do it BEFORE calling 'Provider'

See more: