Skip to content

Typing Hits in version 7 #6419

Answered by dhayab
Sembauke asked this question in Q&A
Oct 31, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi, you'll be able to import this type from instantsearch.js like this:

import type { Hit } from 'instantsearch.js';

interface SuggestionProps {
  hit: Hit;
 /* ... */
}

It also is a generic type, so you can enrich it with your records type definition. You can find an example on our React InstantSearch getting-started code sandbox.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dhayab
Comment options

@Sembauke
Comment options

Answer selected by dhayab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Library: React InstantSearch ≥ 7 Issues in any of the react-instantsearch@7 packages (formerly named react-instantsearch-hooks)
2 participants