snowballtools-base/packages/frontend/src/components/shared/AsyncSelect.tsx
Nabarun Gogoi 1c9597739b
Change UI for create new project page (#54)
* Change create new project ui for git authentication

* Use submit handler method from react hook form

* Handle review changes

* Have a pre-selected value for connect account tab panel
2024-02-05 16:56:53 +05:30

18 lines
608 B
TypeScript

// https://github.com/creativetimofficial/material-tailwind/issues/419#issuecomment-1760474312
import React, { useEffect, useState } from 'react';
import { Select, SelectProps } from '@material-tailwind/react';
// TODO: Use correct type for ref
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const AsyncSelect = React.forwardRef((props: SelectProps, ref: any) => {
const [key, setKey] = useState(0);
useEffect(() => setKey((preVal) => preVal + 1), [props]);
return <Select key={key} ref={ref} {...props} />;
});
AsyncSelect.displayName = 'AsyncSelect';
export default AsyncSelect;