Skip to content

Commit

Permalink
fix: fix nbHits display
Browse files Browse the repository at this point in the history
  • Loading branch information
gmoocto committed Nov 21, 2023
1 parent 605a985 commit 3980072
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SendEventForHits } from 'instantsearch.js/es/lib/utils/createSendEventF
import { BaseHit } from 'instantsearch.js/es/types/results';
import singletonRouter from 'next/router';
import React, { useRef } from 'react';
import { Configure, Hits, InstantSearch, useInstantSearch } from 'react-instantsearch';
import { Configure, Hits, InstantSearch, useInstantSearch, useStats } from 'react-instantsearch';
import { createInstantSearchRouterNext } from 'react-instantsearch-router-nextjs';

import { Container } from '~/client/components/layouts/Container/Container';
Expand Down Expand Up @@ -131,6 +131,7 @@ const AfficherResultatDeRecherche = React.forwardRef(function AfficherResultatDe

const { status, results } = useInstantSearch();
const isSettingUp: boolean = results.__isArtificial ?? false;
const { nbHits } = useStats();

const ref = useSynchronizedRef(outerRef);

Expand All @@ -144,7 +145,7 @@ const AfficherResultatDeRecherche = React.forwardRef(function AfficherResultatDe
labelSingulier={messageResultatRechercheLabelSingulier}
labelPluriel={messageResultatRechercheLabelPluriel}
isLoading={isInstantSearchLoading}
numberOfResult={results.nbHits}
numberOfResult={nbHits}
/>
</Container>
</section>
Expand Down

0 comments on commit 3980072

Please sign in to comment.