pass parameter to link react code example
Example 1: react router link with params
<Link to={{
pathname: '/tylermcginnis',
state: {
fromNotifications: true
}
}}>Tyler McGinnis</Link>
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;