How to deal with data in redux?

the specific scenarios are as follows:

// reducer.js
const initialState = {
    test: [
        {    
            id: 1
            show: true    
        },
        {    
            id: 2
            show: true    
        },
        {    
            id: 3
            show: true    
        }
    ]
}
export function testUp(state=initialState, action) {
    switch (action.type) {
        case UPDATE: {
          return {
            ...state,
            // ...action.payload, cidList
            takeCidList(state.test, action.payload)
          }
        }
        default:
          return state
      }
}
function takeCidList(test, cidList) {
    const list = []
    // todo get initialState.test
    return list
}

// test.jsx
class Test extends Component {
    // ...
    updateTestState = idList => {
        this.props.updateTestState(idList)
        // idList = [1,4,6,8] id
    }
}
export default connect(null, {updateTestState})(Test)

// action.js
export const updateTestState = idList => ({type: UPDATE, payload: idList})
To put it simply, I am what I got in the react component is an array of id. What I need to do is to find out that the id in the test array in state is equal to [1 code 2 show 3 code 4] and change their false field to . So where should such a step be done?
in test.jsx? So I need to get the state of test in test.jsx. And is it really good to handle data in a container component?
in reducer.js? It doesn"t feel pure enough, huh?

Mar.20,2021
In the case of

this, the data in state is generally general-purpose data, and then it can be mapped on demand according to the data structure required by a component. As for where you say to do this step, do it in mapStateToProps , so that you can map appropriately according to the needs of the component. The data structure of state had better be flattened. I hope it will help you

.
Menu