Skip to content

Commit 5b9a5e3

Browse files
authored
Fix typos in "Using combineReducers"
1 parent 070507f commit 5b9a5e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/recipes/reducers/04-UsingCombineReducers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const secondNamedReducer = (state = 2, action) => state;
3636
// rootReducer.js
3737
import {combineReducers, createStore} from "redux";
3838

39-
import theDefaultReducer, {firstNamedReducer, secondNamedReducer} "./reducers";
39+
import theDefaultReducer, {firstNamedReducer, secondNamedReducer} from "./reducers";
4040

4141
// Use ES6 object literal shorthand syntax to define the object shape
4242
const rootReducer = combineReducers({
@@ -47,7 +47,7 @@ const rootReducer = combineReducers({
4747

4848
const store = createStore(rootReducer);
4949
console.log(store.getState());
50-
// {renamedDefaultReducer : 0, secondNamedReducer : 1, someSpecificStateKeyName : 2}
50+
// {theDefaultReducer : 0, firstNamedReducer : 1, secondNamedReducer : 2}
5151
```
5252

5353
Notice that because we used the ES6 shorthand for defining an object literal, the key names in the resulting state are the same as the variable names from the imports. This may not always be the desired behavior, and is often a cause of confusion for those who aren't as familiar with ES6 syntax.

0 commit comments

Comments
 (0)