1 | import { createContext, useContext } from 'react';
|
2 | import { noop } from '../utils';
|
3 | export var TypeaheadContext = createContext({
|
4 | activeIndex: -1,
|
5 | hintText: '',
|
6 | id: '',
|
7 | initialItem: null,
|
8 | inputNode: null,
|
9 | isOnlyResult: false,
|
10 | onActiveItemChange: noop,
|
11 | onAdd: noop,
|
12 | onInitialItemChange: noop,
|
13 | onMenuItemClick: noop,
|
14 | selectHintOnEnter: undefined,
|
15 | setItem: noop
|
16 | });
|
17 | export var useTypeaheadContext = function useTypeaheadContext() {
|
18 | return useContext(TypeaheadContext);
|
19 | }; |
\ | No newline at end of file |