SubmittableInput.tsx 502 B

1234567891011121314151617181920
  1. import type { ReactElement } from 'react';
  2. import type { SubmittableInputProps } from './types';
  3. import { useSubmittable } from './use-submittable';
  4. export const SubmittableInput = (
  5. props: SubmittableInputProps,
  6. ): ReactElement<HTMLInputElement> => {
  7. // // autoFocus
  8. // useEffect(() => {
  9. // if (inputRef?.current == null) {
  10. // return;
  11. // }
  12. // inputRef.current.focus();
  13. // });
  14. const submittableProps = useSubmittable(props);
  15. return <input {...submittableProps} />;
  16. };