-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Ant Design 5 #204
Comments
Hi i have updated to Ant Design 5 and having problem with formik-antd. Would you please add support for ant design 5? |
Hello guys thank you for supporting formik antd. |
It probably is relatively easy to support antd5, I,m a bit overloaded with work though... Ill try to look into it this week |
Or feel free to open a PR |
Added storybook and started working on support for v5: #205 |
new version with support for antd5 : 3.0.0-beta.0 I only tested locally within storybook. Most components just seem to work fine. Can you please test and report here? |
The following command cannot be used: |
keepOffset does not work in DatePicker. |
ERROR in node_modules/formik-antd/src/tree-select/index.tsx:23:4
|
FYI as antd 5 defaults to dayjs instead of moment I did the same and also removed keepOffset from all date/time components. |
When running "npm run tsc" : 14 src/date-picker/index.tsx:33:8 - error TS2786: '$DatePicker' cannot be used as a JSX component. 33 <$DatePicker src/date-picker/index.tsx:60:8 - error TS2786: '$MonthPicker' cannot be used as a JSX component. 60 <$MonthPicker src/date-picker/index.tsx:84:8 - error TS2786: '$RangePicker' cannot be used as a JSX component. 84 <$RangePicker src/date-picker/index.tsx:109:8 - error TS2786: '$WeekPicker' cannot be used as a JSX component. 109 <$WeekPicker src/field/index.tsx:11:13 - error TS2786: 'FastField' cannot be used as a JSX component. 11 return <FastField {...restProps}>{children} Found 6 errors in 3 files. Errors Files |
new version 3.0.0-beta.3 |
new version 3.0.0-beta.4 |
Hi, before upgrading I didn't have any errors in my project, after upgrading antd to v5.x and formik-antd to v3.0.0-beta.4 I am getting this error: index.js:1 Warning: [antd: Form.Item] A I read about this error in antd docs but it seems that I have done everything right. Structure of my forms is the same as before. Maybe I am missing something. Example of my text input in Formik Form: Thank you! |
@tmiroslav97 can you show some code? |
3.0.0-beta.6 landed |
@jannikbuschke error has disappeared after installing beta.6 (I saw that you implemented that in this commit 10b188a) but there is another problem now. Bindings are not working, initial values that аrе passed to Form are not displayed when I open form. When I am filing form binding is working, only problem is with initial values. With beta.4 I didn't have this problem. Does anyone else have the same problem with beta.6? |
I can confirm that initial values are no longer working in beta.5 or beta.6. beta.4 does work and has the "must have a single child element." issue. All beta versions are very slow/sluggish when filling text fields, with or without validation. |
In this sample app https://github.com/jannikbuschke/formik-antd/tree/beta/3.0/sample-app I use beta.6 and initial values work (at least tested for Input) |
I will try to explain better. Initial values are binded to fields but they are not visible when form is opened, if I try to submit that form everything is fine they are corectly sent to api client for instance. I will try to test this more deeper. |
Can you check if this happens for you in this example? https://github.com/jannikbuschke/formik-antd/tree/beta/3.0/sample-app becase I dont see this behavior. |
@jannikbuschke Hi, I checked everyting now and I know where is the problem, but I don't know why. All my form components are wrapped with FormItem, and every component that has FormItem cannot show initial value. In your example you only have field userName wrapped with FormItem or in your case exactly Form.Item. If you try to set initial value for userName you will see that this value is not displayed on your sample-app-form. So maybe there is a problem with FormItem component. Also, when I wrote here first time that I noticed this warning |
Ok, this probably helps, Ill try to look at it again this evening or this weekend |
Should work now in 3.0.0-beta.7. |
I got this error with antd 5.1.4 and formik-antd 3.0.0-beta.7 when I tried to run React app. Do you have any idea ?
|
It seems that everything works know. It works a bit slow but it's fine. Thank you! |
Same Error With Nextjs |
why is button a default import here, this is the origin of the above bug itself |
All issues with imports here seem unrelated to formik-antd and are rather related to wrong configurations of bundlers. |
running in dev mode works fine, the error only comes up when running build @thraizz |
i removed formik-antd and i was able to build, started afresh added formik-antd and same error pops up on build `info - Collecting page data .C:\Users\X30\Documents\codes\bridge-admin\node_modules\antd\es\button\index.js:1 SyntaxError: Cannot use import statement outside a module
|
Any update on this issue ? |
I dont have time to really work on this. If someone can create a repro, maybe even in the form of a repository than maybe I could play around with it, or others might be able to pick it up from there |
We made a fork to try and fix it, the only change to make is the import in in the
with
|
Ok, fixed in beta 8 |
When trying to use the switch component defined like this |
Hey EDIT: I tried manually adding it to this package through my node_modules, along with the localeData plugin and it seems to work now. |
Still get this issue on version
|
up 👍 |
Any ideas on how se solve this Form.Item issue mentioned by @hoanganhtran1010 so we can use the latest antd version? |
Did any one solve this issue? |
I don't know exactly why, but I got value initialization working after I gave each Form.Item valuePropName={"_"} (actually any value other than "value") |
I think I fixed it, can you check with the latest version? |
Sorry for not getting back to you earlier @jannikbuschke, but thank you for this. It seems to be working with the latest version of antd. |
@thj-dk So which version should we use with antd 5, 3.0.0-beta.9? |
Yes. That's what we're using now with the latest version of antd. |
@jannikbuschke turns out that there's some issues with |
For Input.TextArea, besides initialValue not being taken into account, value seems to be visually persisting even when it was technically emptied (manually with |
@jannikbuschke, did you get the chance to take a look at it? |
Hi @jannikbuschke, I created #219 that fixe the issue of |
Thank you @jannikbuschke :-) |
I should somehow improve this workflow, forgot a bit how to do it : ) |
@jannikbuschke |
For those who may have missed it, there's now a EDIT: I can't quite figure out what's wrong, but using the same setup I was using pre-beta, my radio group has every radio button selected. I wasn't able to figure this out, but if anyone else runs into it, a workaround is to directly use the Radio/Radio.Group components from antd, and use the group's |
Hi there, just wondering whether you were considering support for Ant Design 5…
The text was updated successfully, but these errors were encountered: