The state of this element is Undefined for first time?
问题 I am trying to create toggle switch in my application and i am new to redux. Posting this question after trying very hard and looking eveywhere online.Please help. My Reducer is below: const initialState = { preview: "off", cards: }; const cardReducer = (state = initialState, action) => { switch (action.type) { case "FIND_ALL_CARDS": return { cards: action.cards }; case "DELETE_CARD": return { cards: state.cards.filter(card => card.id !== action.cardId) }; case "CREATE_CARD": return { cards: