how to pass data in router link react-typescript code example
Example 1: how to pass data in router link react-typescript
<Route
path='/project/:id'
render={({ location }) => {
const { state } = location;
return <ProjectDetails project={state.project} />
}}
/>
Example 2: how to pass data in router link react-typescript
<Link
to={{
pathname: path,
state: {
project,
},
}}
key={project.id}
>
<ProjectSummary project={project} deleteCallback={projectDelete}/>
</Link>