Skip to main content
This is the React InstantSearch v7 documentation. If you’re upgrading from v6, see the upgrade guide. If you were using React InstantSearch Hooks, this v7 documentation appliesβ€”just check for necessary changes. To continue using v6, you can find the archived documentation.

About this widget

This widget lets you apply ruleContexts based on filters to trigger context-dependent rules. The <QueryRuleContext> widget isn’t part of React InstantSearch, but you can make a custom version with useQueryRules.

Examples

import { useQueryRules } from "react-instantsearch";

export function QueryRuleContext(props) {
  useQueryRules(props);

  return null;
}
⌘I