To pass the state from one component to another, you need to call an API, and then you would need to setup redux. After this, you can call an action where you will call an API and set its response in your reducer. The response can then be accessed in the component through the props.

BY Best Interview Question ON 26 Sep 2020

Example

//component
handleSubmit=()=>{
   const {data}=this.state;
   this.props.callAPI(data)
}

Action.js
   export function callAPI(data){
   return (dispatch)=>{
      dispatch(getData(data))
   }
}

function getData(data){
   //use fetch/axios to call the api
}
//in your component, use connect({mapStateToProps},{mapDispatchToProps})
(nameofYourComponent) and you can use your data as props.