#Module '"react-hook-form"' has no exported member 'SubmitHandler'.
1 messages · Page 1 of 1 (latest)
It seems that you have imported the module incorrectly!
Either provide a picture of your code or refer to the documentation of these two libraries and read the documentation more carefully.
If you are using TypeScript, add the types of these two libraries to the project.
as far as I know, I think bun still has some issues with React so it might also come from that
lacking a bit of support ! ^.^, but Mohsen is right, if you can show some code and/or open an issue for them to look at it (and if they can fix it) (if it's a bun issue) then that would be great ^.^
when you hover them what does it say @flint thicket
that's weird, isn't it just a TS issue
have you tried restarting ts server
I know it's really dumb but 🤷🏻♂️
and what if you ctrl + click on "react-hook-form" and check the exports
also you could try to do
import rhf from "react-hook-form" and do rhf.SubmitHandler and see if it works
import rhs from "react-hook-form";
const Login: React.FC = (): React.ReactElement => {
const navigate = useNavigate();
const { register, handleSubmit, setValue, setError, formState: { errors } } = rhs.useForm<Inputs>();
^^^^^^^
...
}
Property 'useForm' does not exist on type 'typeof import("/root/Projects/test/website/frontend/node_modules/react-hook-form/dist/index")'.
didn't work
Can you try using latest version react-hook-form?
I was also trying to import react-datepicker and react-select and got default import issues and when I upgraded to latest version it worked somehow
Same issue with with rechart and @nivo and latest version fixed it
i do have the last version "react-hook-form": "^7.51.1",
React-chartjs-2 worked?
Nop
Is SubmitHandler a typescript type and not at runtime? If so, can you try prefixing the value with type
import {type SubmitHandler} from “react-hook-form”
I'm sure these are both functions
Its working for me. I have tested this in below PR of my github
https://github.com/hedaukartik/bun-react-csr-base/pull/2
@flint thicket 👆
Try with react-hook-form
I have used react-hook-form only🤷♂️😵💫
are you using vite ?