docs question #4596
docs question
#4596
Replies: 1 comment
-
It's normal to do a default export of the reducer function from a slice file, and named exports of the actions: const counterSlice = createSlice({ /* */})
export {increment, decrement} = counterSlice.actions;
export default counterSlice.reducer; When you do the default import, you can give that variable any name you want: import AnyNameYouWantHere from "../features/counter/counterSlice"; But normally you'd call it something like import counterReducer from "../features/counter/counterSlice"; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi i am following the tutorial and it says this here `We have a file named features/counter/counterSlice.js that exports a reducer function for the counter logic. We can import that counterReducer function here, and include it when we create the store.
` here's link https://redux.js.org/tutorials/essentials/part-2-app-structure but I don't see anything called counterReducer in counterSlice.js
can someone explain this?
Beta Was this translation helpful? Give feedback.
All reactions