Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Only tested with React and Vue 2 for now, the examples still work well.
One problem for now with Vue 2 is that we can't use
DefaultHitComponent
, as you can't callh
with a function component. Maybe Vue 3 will work. Otherwise we can call it as a function as it doesn't have state so it may be fine not to have it as a React/Preact fiber.Next is to try with Preact (expecting TS errors) and Vue 3.
Also has to keep in mind : in React we also pass
div
props, we need to find a way to properly type it for the user, without relying on React types ininstantsearch-jsx
.Update 1 : Vue3 works out of the box, moved Vue2 compat code in its own file and now the same code works for both versions, even
DefaultHitComponent
works ! (save for slots which are still under a condition)Update 2 : For Preact surprisingly types worked easily, however with the way we do templating, we need to have an additional
itemComponent
prop which contains theli
itself :/