update react-instantsearch-dom & core (#35940)

* update react-instantsearch-dom & core

* fixup! update react-instantsearch-dom & core

* fixup! update react-instantsearch-dom & core

* fixup! update react-instantsearch-dom & core
This commit is contained in:
Alex Young
2019-06-05 14:35:52 -07:00
committed by Andrew Casey
parent fef7062f34
commit 1b05cbea62
4 changed files with 18 additions and 26 deletions
+3 -2
View File
@@ -341,10 +341,11 @@ export function connectHitsPerPage(Composed: React.ComponentType<any>): React.Co
export interface InfiniteHitsProvided<THit = any> {
/** the records that matched the search */
hits: THit[];
/** a function to toggle the refinement */
refine: (...args: any[]) => any;
/** indicates if there are more pages to load */
hasMore: boolean;
hasPrevious: boolean;
refineNext: (...args: any[]) => any;
refinePrevious: (...args: any[]) => any;
}
/**
+5 -5
View File
@@ -55,21 +55,21 @@ interface CommonWidgetProps {
}
export interface InstantSearchProps {
apiKey: string;
appId: string;
apiKey?: string;
appId?: string;
indexName: string;
algoliaClient?: any;
searchClient?: any;
createURL?: (...args: any[]) => any;
searchState?: any;
refresh?: boolean;
onSearchStateChange?: (...args: any[]) => any;
onSearchParameters?: (...args: any[]) => any;
resultsState?: any;
stalledSearchDelay?: number;
root?: {
Root: string | ((...args: any[]) => any);
props: any;
props?: object;
};
}
/**
@@ -80,9 +80,8 @@ import { Hit, connectRefinementList, connectMenu } from 'react-instantsearch-cor
function App() {
return (
<InstantSearch
appId="latency"
apiKey="6be0576ff61c053d5f9a3225e2a90f76"
indexName="instant_search"
searchClient={{}}
>
<Hits hitComponent={Hit} />
</InstantSearch>
@@ -116,9 +115,8 @@ import { Hit, connectRefinementList, connectMenu } from 'react-instantsearch-cor
// function App() {
// return (
// <InstantSearch
// appId="latency"
// apiKey="6be0576ff61c053d5f9a3225e2a90f76"
// indexName="instant_search"
// searchClient={{}}
// >
// <Hits hitComponent={Hit} />
// </InstantSearch>
@@ -130,9 +128,8 @@ import { Hit, connectRefinementList, connectMenu } from 'react-instantsearch-cor
() => {
const App = () => (
<InstantSearch
appId="..."
apiKey="..."
indexName="..."
searchClient={{}}
>
<Menu
attribute="fruits"
@@ -147,9 +144,8 @@ import { Hit, connectRefinementList, connectMenu } from 'react-instantsearch-cor
// () => {
// const App = () => (
// <InstantSearch
// appId="..."
// apiKey="..."
// indexName="..."
// searchClient={{}}
// >
// <SearchBox defaultRefinement="hi" />
// <RefinementList
@@ -166,9 +162,8 @@ import { Hit, connectRefinementList, connectMenu } from 'react-instantsearch-cor
() => {
const App = () => (
<InstantSearch
appId="..."
apiKey="..."
indexName="..."
searchClient={{}}
>
<SearchBox defaultRefinement="hi" />
<Menu attribute="fruits" defaultRefinement="Orange" />
@@ -182,9 +177,8 @@ import { Hit, connectRefinementList, connectMenu } from 'react-instantsearch-cor
// const App = () => (
// <InstantSearch
// appId="..."
// apiKey="..."
// indexName="..."
// searchClient={{}}
// >
// <div>
// <CurrentRefinements
@@ -207,9 +201,8 @@ import { Hit, connectRefinementList, connectMenu } from 'react-instantsearch-cor
() => {
// https://community.algolia.com/react-instantsearch/guide/Search_parameters.html
<InstantSearch
appId="appId"
apiKey="apiKey"
indexName="indexName"
searchClient={{}}
>
<Configure distinct={1}/>
// widgets
@@ -246,9 +239,8 @@ import { renderToString } from 'react-dom/server';
render() {
return (
<InstantSearch
appId="appId"
apiKey="apiKey"
indexName="indexName"
searchClient={{}}
searchState={this.props.searchState}
resultsState={this.props.resultsState}
>
@@ -262,7 +262,7 @@ import { createInstantSearch } from "react-instantsearch-core";
() => {
const App = () => (
<InstantSearch appId="" apiKey="" indexName="first">
<InstantSearch indexName="first" searchClient={{}}>
<SearchBox />
<AllResults>
<div>
@@ -374,9 +374,8 @@ import { createInstantSearch } from "react-instantsearch-core";
const App = () => (
<InstantSearch
appId="..."
apiKey="..."
indexName="..."
searchClient={{}}
>
<SearchBox defaultRefinement="hi" />
<Hoodies />