pass data with react router link code example
Example 1: passing data in route react
<Route path="/" component={() => <Search name={this.props.name} />} />
Example 2: passing data in route react
<Route path="/:name" component={Search} />
<Route path="/" component={() => <Search name={this.props.name} />} />
<Route path="/:name" component={Search} />