React two unrelated components how does component 2 change when component 1 changes a state

I pass values through redux

scenario is when I click on the navigation bar of component 1 and refresh the ajax of component 2

is the data returned by ajax accepted by this.state.contnet

what should I write? There is an urgent need for ideas.

Feb.26,2021

then you should distribute an action that is responsible for requesting data


when you click on component 1, handleclick

this.props.dispatch({type:'COMPONENT2_AJAX'})

then after the COMPONENT2_AJAX action in actions is successful, that is, after getting the data, execute
dispatch ({type:'SET_STATE_CONTENT',content})
modify content,. I don't understand why you use redux and state

.

with redux, you have to hand over all state to redux management, and this.state is only used within the component. Between components, you need to pass state managed by redux through props .

you are in the event of clicking component 1

  

you call the ajax method of component 2 in the click component 1 method, and setState the result into content

Menu