I am in the process of migrating an older project to utilize react and react-router. Additionally, I am fairly new to typescript, which is the language used for this particular project. Any guidance or explanations on these topics would be highly beneficial.
The route is configured as follows:
<Route
path="/deployments/:somePrefix/:someId"
component={SomeDetailPage}/>
However, within SomeDetailPage, when attempting to access the parameters in order to execute a function on them (
(this.props.match.params.somePrefix
, or this.proper.match.params.someId)
), the following error occurs:
ERROR in [at-loader] src/public/components/some-detail-page.tsx:25:97
Property 'somePrefix' does not exist on type '{}'
ERROR in [at-loader] src/public/components/some-detail-page.tsx:25:97
Property 'someId' does not exist on type '{}'
Despite knowing that these params do indeed exist, whenever attempting to test by incorporating them into a div element (just as a random test), the div fails to load and generates the subsequent error:
Objects are not valid as a React child (found: object with keys {somePrefix, someId})