src/SearchPage/index.js
/**
   * Get the query if it exists. If redirecting from MainPage, the state should
   * be defined. If not, the state will be undefined.
   */
Get the query if it exists. If redirecting from MainPage, the state should
be defined. If not, the state will be undefined.
Get the query if it exists . If redirecting from MainPage the state should be defined . If not the state will be undefined .
componentDidMount() {
    const { location } = this.props;
    if (location && location.state && location.state.query !== '') {
      this.setState({ query: location.state.query });
      this.sendQuery(location.state.query);
    }
  }
componentDidMount ( ) { const { location } = this . props ; if ( location && location . state && location . state . query !== '' ) { this . setState ( { query : location . state . query } ) ; this . sendQuery ( location . state . query ) ; } }
Get the query if it exists.
Get the query if it exists .