mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 09:10:09 +00:00
Improve events on SearchBox
This commit is contained in:
5
types/react-instantsearch-dom/index.d.ts
vendored
5
types/react-instantsearch-dom/index.d.ts
vendored
@@ -118,8 +118,9 @@ export interface SearchBoxProps extends CommonWidgetProps {
|
||||
reset?: JSX.Element;
|
||||
loadingIndicator?: JSX.Element;
|
||||
|
||||
onSubmit?: (...args: any[]) => any;
|
||||
onReset?: (...args: any[]) => any;
|
||||
onSubmit?: (event: React.SyntheticEvent<HTMLFormElement>) => any;
|
||||
onReset?: (event: React.SyntheticEvent<HTMLFormElement>) => any;
|
||||
onChange?: (event: React.SyntheticEvent<HTMLInputElement>) => any;
|
||||
}
|
||||
/**
|
||||
* The SearchBox component displays a search box that lets the user search for a specific query.
|
||||
|
||||
@@ -216,6 +216,21 @@ import { Hit, connectRefinementList, connectMenu } from 'react-instantsearch-cor
|
||||
</InstantSearch>;
|
||||
};
|
||||
|
||||
(() => {
|
||||
function onSearchBoxChange(event: React.SyntheticEvent<HTMLInputElement>) {
|
||||
}
|
||||
|
||||
function onSearchBoxReset(event: React.SyntheticEvent<HTMLFormElement>) {
|
||||
}
|
||||
|
||||
function onSearchBoxSubmit(event: React.SyntheticEvent<HTMLFormElement>) {
|
||||
}
|
||||
|
||||
<SearchBox
|
||||
onChange={onSearchBoxChange} onReset={onSearchBoxReset} onSubmit={onSearchBoxSubmit}
|
||||
submit={<></>} />;
|
||||
});
|
||||
|
||||
import { createInstantSearch } from 'react-instantsearch-dom/server';
|
||||
// import { createServer } from 'http';
|
||||
declare function createServer(handler: (req: any, res: any) => any): any;
|
||||
|
||||
Reference in New Issue
Block a user