Type safe HistoryState in navigate
We're relying on HistoryState in our application and while params and search are both very well handled in the docs and the API,
I find HistoryState far less easy to work with.. probably a skill issue
.
I keep running in to the TS error using navigate
The best workaround I found is when I want to use navigate is the following:
But this feels terrible and provides no type safety as I'm just casting it, would be nice to have something similar to
similarly when consuming state I have to do the same.
Any suggestions how to work with state in a type safe matter using the lib is greatly appreciated.
I find HistoryState far less easy to work with.. probably a skill issue
I keep running in to the TS error using navigate
Object literal may only specify known properties, and 'bar' does not exist in type 'NonNullableUpdater<HistoryState>'The best workaround I found is when I want to use navigate is the following:
But this feels terrible and provides no type safety as I'm just casting it, would be nice to have something similar to
validateSearch for State.. similarly when consuming state I have to do the same.
Any suggestions how to work with state in a type safe matter using the lib is greatly appreciated.