My app has 2 tabs and I need to modify the content according the click in tab I have this state:
const example = {
tabs: [
{
id: 111,
title: 'Python',
icon: '[email protected]',
content: 'Hello World'
},
{
id: 333,
title: 'EQL',
icon: '[email protected]',
content: 'Hello World 2'
}
]
}
and I need to change the 'content' inside of tabs. I tried this:
return {
...state,
tabs: {
...state.tabs,
content: 'Uhuuuul'
}
}
But this didn't work! Could someone explain why?