can i pass function as prop on route change

Solutions on MaxInterview for can i pass function as prop on route change by the best coders in the world

showing results for - "can i pass function as prop on route change"
Mika
13 Nov 2020
1<Link to={{
2   pathname: '/Content/' + this.props.index
3   state: {decrease: this.props.decreaseIndexProject}
4}}>Page n°1</Link>
5
6<Router>
7  <Switch>
8    <Route path="/Content/:index" exact name="content" component={Content} />
9  </Switch>
10</Router>
11
12// Now in Content you can use it like this.props.location.state.decrease