Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

feat(hooks): introduce useConfigure #3181

Merged
merged 1 commit into from
Oct 27, 2021
Merged

Conversation

francoischalifour
Copy link
Member

This adds useConfigure to our Hooks collection.

API

This hook is a bridge to connectConfigure.

The InstantSearch.js connector and widget both take the searchParameters prop to pass search parameters. In this API, we directly pass the search parameters as props, like in the current <Configure>.

Usage

function Configure(props) {
  useConfigure(props);
  return null;
}

function App(props) {
  return (
    <InstantSearch {...props}>
      <Configure hitsPerPage={40} />

      {/* ... */}
    </InstantSearch>
  );
}

@netlify
Copy link

netlify bot commented Oct 26, 2021

✔️ Deploy Preview for react-instantsearch ready!

🔨 Explore the source changes: e2aa0b8

🔍 Inspect the deploy log: https://app.netlify.com/sites/react-instantsearch/deploys/617837df2c71f40007507707

😎 Browse the preview: https://deploy-preview-3181--react-instantsearch.netlify.app

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e2aa0b8:

Sandbox Source
react-instantsearch-app Configuration
routing-basic Configuration

@francoischalifour francoischalifour merged commit aa2eb9b into master Oct 27, 2021
@francoischalifour francoischalifour deleted the feat/useConfigure branch October 27, 2021 08:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants