Closed jsun969 closed 9 months ago
@jsun969 Yeah it worked in the provided example and it still actually works as expected when I'm testing it manually. It doesn't seem to be working in the test you wrote though. I played around with the test a little but can't figure why it ain't working.
@jakub-szewczyk That seems weird. I add name and default value in source code in this PR (antd need name
to generate the htmlFor
for form field label). Can this be the problem?
https://github.com/jsun969/react-hook-form-antd/blob/d3b8e2e28f3f7103877ca35cfc50c89a2e23b05d/src/FormItem.tsx#L31-L33
I'll try to figure out why before releasing this PR. Thx for your reply!
@jsun969 I don't think the name
prop is a problem.
@jakub-szewczyk I removed example and add tests. But I found that
reset
is still not working. Did it work in your PR? Would you like help me to fix this problem? Thx a lot!https://github.com/jsun969/react-hook-form-antd/blob/d84827e6822eaea6a7c90b75bba4d3a18bc031a2/__tests__/Form.test.tsx#L52-L63