Skip to content

Commit

Permalink
Use hook instead of HOC in AsyncTypeahead
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgio committed Apr 1, 2023
1 parent e6e4b75 commit 2e6fb17
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/AsyncTypeahead/AsyncTypeahead.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { withAsync } from '../../behaviors/async';
import Typeahead from '../Typeahead';
import React, { forwardRef } from 'react';
import { useAsync, UseAsyncProps } from '../../behaviors/async';
import TypeaheadComponent from '../Typeahead';
import Typeahead from '../../core/Typeahead';

// @ts-ignore
export default withAsync(Typeahead);
const AsyncTypeahead = forwardRef<Typeahead, UseAsyncProps>((props, ref) => (
<TypeaheadComponent {...useAsync(props)} ref={ref} />
));

export default AsyncTypeahead;

0 comments on commit 2e6fb17

Please sign in to comment.