Books Reducers Initial State Undefined
I just finished lecture 42. That's about implementing the container class. I'm getting an issue with passing the initial state where my books reducer is being passed an undefined state. From what I can understand, we're passing in a hard coded books object as the state. Can somebody help? I've been stuck on this for about two days now.
Did you ever get this to work?
Yeah - Turned out it was a type and it was fixed when I started over again. Are you getting the same issue?
Hi ! I get this error

I got it after 43 lesson. Can you help me , please
Make sure the first argument you pass on Line 1 of reducer_active_book.js contains state = null.
Like so:
export default function(state = null, action) {
switch(action.type) {
case 'BOOK_SELECTED':
return action.payload;
}
return state;
}
I am doing exactly as @1andee says, yet I still get this error:
export default function(state = null, action) {
switch(action.type) {
case 'BOOK_SELECTED':
return action.payload;
}
return state;
}
bundle.js:21410 Uncaught Error: Reducer "activeBook" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined