Commit 5f35c8c
authored
fix(react): Make Route typing more generic (#3809)
DefinitelyTyped/DefinitelyTyped#51355 merging in
lead to some more robust type inference for React Router params. This
means that for Typescript >= 4.1.5, certain param types break when using
the `withSentryRouting` higher order component.
To fix this issue, we use a generic instead of a React component type
for the wrapped React component. As we have to use this generic instead
of a specific React type, we have to use @ts-ignore to make the JSX
expressions work with typescript.
Fixes #38081 parent 90eb35c commit 5f35c8c
1 file changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
153 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
164 | 171 | | |
165 | 172 | | |
| 173 | + | |
0 commit comments