How to use the react-instantsearch/connectors.connectCurrentRefinements function in react-instantsearch

To help you get started, we’ve selected a few react-instantsearch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / react-instantsearch / examples / react-native / src / Home.js View on Github external
);
          }}
          dropdownStyle={{
            width: 200,
            height: 110,
          }}
          textStyle={{ fontSize: 15 }}
        />
        {icon}
      
    );
  }
);

const Filters = connectCurrentRefinements(
  ({ items, searchState, onSearchStateChange }) => (
    <button>
        /* eslint-disable new-cap */
        Actions.Filters({
          searchState,
          onSearchStateChange,
        })
      }
      /* eslint-enable new-cap */
      title={`Filters (${items.length})`}
      color="#162331"
    /&gt;
  )
);
const VirtualRange = connectRange(() =&gt; null);</button>
github algolia / react-instantsearch / examples / react-native / src / Filters.js View on Github external
keyboardShouldPersistTaps={'always'}
          style={styles.mainContainer}
        /&gt;
      
    );
  }
}

Refinements.propTypes = {
  searchState: PropTypes.object.isRequired,
  refine: PropTypes.func.isRequired,
  onSearchStateChange: PropTypes.func.isRequired,
  items: PropTypes.array.isRequired,
};

const ConnectedRefinements = connectCurrentRefinements(Refinements);
const VirtualRefinementList = connectRefinementList(() =&gt; null);
const VirtualSearchBox = connectSearchBox(() =&gt; null);
const VirtualMenu = connectMenu(() =&gt; null);
const VirtualRange = connectRange(() =&gt; null);

export default Filters;
github jscoach / client / src / ClearAll.js View on Github external
import React from "react";
import { connectCurrentRefinements } from "react-instantsearch/connectors";

const ClearAll = connectCurrentRefinements(
  ({ items, refine }) =&gt;
    items.length &gt; 0 &amp;&amp; (
      <button> refine(items)}
        className="tracking-tight mb-2 float-right text-orange-dark"&gt;
        Clear filters
      </button>
    )
);

export default ClearAll;