-
Notifications
You must be signed in to change notification settings - Fork 34
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
History v5 types error + back and forward actions are not exported #99
Comments
I think the possible solution is to leave history v4 behind and fully switch to v5. It will get rid of type errors and use appropriate methods |
Getting these errors too, currently transitioning from react-router v5 to v6 and it's tripping me up. At present, my app won't compile, but it's not clear if it's from this specific issue or from something else. Update- the issue blocking actual building of the app was something else, but the warning persists in an otherwise successful app execution now that I'm fully on v6 for |
Hi!
You can create a type declaration file and extend library types with
yours.I solved it by that for a moment
чт, 13 окт. 2022 г., 00:47 connorcook-shippo ***@***.***>:
… Getting these errors too, currently transitioning from react-router v5 to
v6 and it's tripping me up. At present, my app won't compile, but it's not
clear if it's from this specific issue or from something else.
—
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOAGCHVWGAPFNLMGMFV3X43WC4WV7ANCNFSM6AAAAAAQ4L7WMM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I am seeing the same incompatibility with this and the latest > tsc --noEmit
node_modules/redux-first-history/src/actions.ts:48:71 - error TS2339: Property 'goBack' does not exist on type 'History'.
48 export const goBack: () => CallHistoryMethodAction<Parameters<History['goBack']>> =
node_modules/redux-first-history/src/actions.ts:50:74 - error TS2339: Property 'goForward' does not exist on type 'History'.
50 export const goForward: () => CallHistoryMethodAction<Parameters<History['goForward']>> = I think it was missed because this project's dev dependency is still on history v4 when these properties still existed. It was an undocumented breaking change in history v4 -> v5, see remix-run/history#811 |
I will be the first to admit I'm not familiar with the best way to solve this issue, nor have I made many contributions to package development- but if we know it'll have either If that isn't possible, then the original suggestion to abandon history v4 altogether- potentially with a minor, or even major, version change- is probably the next best option here. It feels like potential overkill for just this issue, so if we have an easier way to solve it that would probably be preferred, but... it's gotta happen at some point anyway, right? |
as a workaround for the compilation error you can add this somewhere in your code:
and then just use |
I have placed the following file // eslint-disable-next-line @typescript-eslint/no-unused-vars
import Histroy from 'history';
declare module 'history' {
interface History{
goBack(): void;
goForward(): void;
}
} |
The text was updated successfully, but these errors were encountered: