Skip to content

Commit 5d627a6

Browse files
committed
Export core components from root file
1 parent 8ee4afb commit 5d627a6

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Components
1+
export * from './core';
2+
23
export { default as AsyncTypeahead } from './components/AsyncTypeahead';
34
export { default as ClearButton } from './components/ClearButton';
45
export { default as Highlighter } from './components/Highlighter';

src/tests/index.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
MenuItem,
1010
Token,
1111
Typeahead,
12+
TypeaheadContext,
1213
TypeaheadInputMulti,
1314
TypeaheadInputSingle,
1415
TypeaheadMenu,
@@ -17,6 +18,7 @@ import {
1718
useItem,
1819
useOverlay,
1920
useToken,
21+
useTypeahead,
2022
} from '..';
2123

2224
import _AsyncTypeahead from '../components/AsyncTypeahead';
@@ -41,6 +43,11 @@ import {
4143
useToken as _useToken,
4244
} from '../hooks';
4345

46+
import {
47+
useTypeahead as _useTypeahead,
48+
TypeaheadContext as _TypeaheadContext,
49+
} from '../core';
50+
4451
describe('index.ts exports', () => {
4552
it('exports the components', () => {
4653
expect(AsyncTypeahead).toBe(_AsyncTypeahead);
@@ -65,4 +72,9 @@ describe('index.ts exports', () => {
6572
expect(useOverlay).toBe(_useOverlay);
6673
expect(useToken).toBe(_useToken);
6774
});
75+
76+
it('exports core hooks and context', () => {
77+
expect(TypeaheadContext).toBe(_TypeaheadContext);
78+
expect(useTypeahead).toBe(_useTypeahead);
79+
});
6880
});

0 commit comments

Comments
 (0)