SubmittableInput.tsx 511 B

1234567891011121314151617181920212223
  1. import type {
  2. ReactElement,
  3. } from 'react';
  4. import type { SubmittableInputProps } from './types';
  5. import { useSubmittable } from './use-submittable';
  6. export const SubmittableInput = (props: SubmittableInputProps): 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 (
  16. <input {...submittableProps} />
  17. );
  18. };