I wrote some code to get an entity indicator id from the end of a route in a React component:
const pathname = this.props.location.pathname;
const lastPathPart = pathname.split('/').slice(-1)[0];
const requestedJobId = Number(lastPathPart);
The code above gets the requested job id from the end of the route as needed/expected but is there a more proper or structured way to do this in React?