API Reference / React InstantSearch Hooks / useRatingMenu()

About this Hook

The useRatingMenu Hook isn’t currently available in React InstantSearch Hooks, but you can make it yourself using useConnector() along with connectRatingMenu.

Refer to the connectRatingMenu documentation for the full API reference.

Examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { useConnector } from 'react-instantsearch-hooks-web';
import connectRatingMenu from 'instantsearch.js/es/connectors/rating-menu/connectRatingMenu';

export function useRatingMenu(props) {
  return useConnector(connectRatingMenu, props);
}

export function RatingMenu(props) {
  const {
    items,
    canRefine,
    refine,
    sendEvent,
    createURL,
  } = useRatingMenu(props);

  return <>{/* Your JSX */}</>;
}
Did you find this page helpful?