title: How to pass data to a page within a <redirect> in React?
body: <p>Right now I am redirecting to a new page using  but I dont know how to pass the data to the new page. This is what I am doing:-</p>
  
  <pre><code>class ShopsCatOptions extends React.Component{
      constructor(props){
          super(props);
          this.state={            
              shopd: this.props.shop,
              redirect:false
  
          };        
      }
  
      render() {
          if (this.state.redirect) {
              return &lt;Redirect push to="./shopdetail" data={this.state.redirect}/&gt;;
          }
  
          return(
              &lt;div class="expndinnerm" onClick={this.handleOnClick}&gt;
              {
                  this.state.shopd        
              }
              &lt;/div&gt;
          )
      }
  
  }
  export default ShopsCatOptions
  </code></pre>
  
  <p>What is the right way to do it?</p>