Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): avoid inferring UiState type from initialUiState (#5061)
* fix(types): make all usages of UiState in InstantSearch generic This allows someone with custom widgets to still use setUiState etc. without type errors * fix lint * fix(types): avoid inferring UiState type from initialUiState if you pass initialUiState, that should be asserted by the generic UiState, not automatically accepted. Otherwise you get use cases like the "with function form sets indices state" test where setUiState thinks query is required, just because it has the default given The way this works is by using `NoInfer` from microsoft/TypeScript#14829 (comment) which seems to be quite relied upon This is a follow-up on #5060
- Loading branch information