how to pass parameter in route react code example
Example 1: passing data in route react
<Route path="/" render={() => <Search name={this.props.name} />} />
Example 2: react pass parameter to component
import React, { Component } from 'react'; class App extends Component { render() { return ( <div> <Greeting /> </div> ); }} class Greeting extends Component { render() { const greeting = 'Welcome to React'; return <h1>{greeting}</h1>; }} export default App;