Hi, Nice article. Thank you.
I would like to use redux dev tools with this in development, but I am finding it difficult to setup. Here is the link to the tool documentation. github.com/zalmoxisus/redux-devtoo...
Can you help take a look?
Thanks, I have figured this out.
What I did!
yarn add redux-devtools-extension
import { composeWithDevTools } from 'redux-devtools-extension';
const composeEnhancers = composeWithDevTools({});
composeEnhancers(applyMiddleware(...middlewares))
import thunkMiddleware from 'redux-thunk'; import { createStore, applyMiddleware, Store as ReduxStore, } from 'redux'; import { createLogger } from 'redux-logger'; import { composeWithDevTools } from 'redux-devtools-extension'; import reducers, { initialState } from './reducers'; const dev: boolean = process.env.NODE_ENV !== 'production'; export type Store = ReduxStore<typeof initialState>; const composeEnhancers = composeWithDevTools({}); export default (state = initialState): Store => { const middlewares = dev ? [thunkMiddleware, createLogger()] : []; return createStore( reducers, state, composeEnhancers(applyMiddleware(...middlewares)) ); };
Yes, you have done right!
Or just replace compose with composeWithDevtools like this commit:
compose
composeWithDevtools
const { composeWithDevTools } = dev ? require('redux-devtools-extension') : require('redux-devtools-extension/logOnlyInProduction'); export default (state = initialState): Store => { const middlewares = dev ? [thunkMiddleware, createLogger()] : []; return createStore(reducers, state, composeWithDevTools(applyMiddleware(...middlewares))); };
Thanks, Do you have an idea of how to include SCSS to this setup?
This is a NEXT.js side. Please see github.com/zeit/next.js/tree/canar...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, Nice article. Thank you.
I would like to use redux dev tools with this in development, but I am finding it difficult to setup.
Here is the link to the tool documentation. github.com/zalmoxisus/redux-devtoo...
Can you help take a look?
Thanks, I have figured this out.
What I did!
yarn add redux-devtools-extension
)import { composeWithDevTools } from 'redux-devtools-extension';
)const composeEnhancers = composeWithDevTools({});
)composeEnhancers(applyMiddleware(...middlewares))
)Update Store.ts file
Yes, you have done right!
Or just replace
compose
withcomposeWithDevtools
like this commit:Thanks, Do you have an idea of how to include SCSS to this setup?
This is a NEXT.js side.
Please see github.com/zeit/next.js/tree/canar...