Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(react-router): Make RouteProps typing more generic #3570

Merged
merged 2 commits into from May 19, 2021

Conversation

AbhiPrasad
Copy link
Member

Fixes #3550

Previously we copied over the typings for a react-router Route props.
This means though that when the react-router updates it's types,
there is a chance our types will break. To avoid this in the future,
this patch removes the RouteProps typing and uses a plain
Record<string, any> type instead.

The props we do leverage from the RouteProps have checks in the code
and there are tests covering that the RouteProps properties exist,
so making the type more generic is not that risky.

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

Previously we copied over the typings for a react-router Route props.
This means though that when the react-router updates it's types,
there is a chance our types will break. To avoid this in the future,
this patch removes the RouteProps typing and uses a plain
`Record<string, any>` type instead.

The props we do leverage from the RouteProps have checks in the code
and there are tests covering that the RouteProps properties exist,
so making the type more generic is not that risky.
@AbhiPrasad AbhiPrasad self-assigned this May 19, 2021
@github-actions
Copy link
Contributor

github-actions bot commented May 19, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 20.76 KB (+0.01% 🔺)
@sentry/browser - Webpack 21.98 KB (0%)
@sentry/react - Webpack 22.01 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.14 KB (+0.01% 🔺)

@AbhiPrasad AbhiPrasad enabled auto-merge (squash) May 19, 2021 13:14
@AbhiPrasad AbhiPrasad merged commit e7f5255 into master May 19, 2021
@AbhiPrasad AbhiPrasad deleted the abhi/location-typing-react-router branch May 19, 2021 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

withSentryRouting react-router v5 typing issue
2 participants