score:1

to fix this issue, withrouter can be used like this in searchresularpage page :

import react, { component } from 'react';
import { withrouter } from 'react-router-dom'

class searchresultpage extends react.component {
    constructor(props) {
      super(props);
      this.state = {
        searchvalue :'',
        paramvalue : ''
      };
    }

    componentdidmount(){
      this.setstate({
        searchvalue: this.props.searchtext,
        paramvalue: this.props.location.state
      })
    }

    render() {
      return (
        <div>
          {this.state.searchvalue}
          {this.state.paramvalue ? this.state.paramvalue.hello : ''}
        </div>

      );
    }
}

export default withrouter(searchresultpage);

hope it helps :)


Related Query

More Query from same tag