I'm facing a problem accessing initialstates array of object for redux.
I have this initial states:
export const initialState = [
{
blogPosts: [
{
title: "",
category: "",
logo: "",
author: "",
date: "",
timeToRead: "",
blogImage: "",
},
],
},
{ filterStatus: "" },
{ filterBy: "" },
];
and I only want to change the filterStatus from my reducer. But trying to do so its changing and also adding one more object in the array.
I was trying this code from my reducer:
case SEARCH_AUTHOR:
return [
...state,
(state[1].filterStatus = "author"),
];
How can I change get rid of this problem?