how to pass data from component to route code example
Example 1: passing data in route react
<Route path="/" render={() => <Search name={this.props.name} />} />
Example 2: passing data in route react
render={routeProps => <Search name={this.props.name} {...routeProps} />}