score:3

Accepted answer

you can pass params through the router, which is accessible through the match prop:

<router>
  <switch>
    <route path="/" exact component={home} />
    <route path="/reports/:parameter" exact component={reportpage} />
    <route path="/reports/browse" exact component={activereportspage} />
    <route path="/signin" exact component={signinpage} />
  </switch>
</router>;

and will then be accessible in the reportspage component as: this.props.match.params.parameter

score:1

also you can useparams

<router>
  <switch>
    <route path="/" exact component={home} />
    <route path="/reports/:parameter" exact component={reportpage} />
    <route path="/reports/browse" exact component={activereportspage} />
    <route path="/signin" exact component={signinpage} />
  </switch>
</router>

and in component reportpage use useparams

let { parameter } = useparams().


Related Query

More Query from same tag