react-component/field-form là dự án tập trung giao diện trên GitHub với 1.0k sao, viết chủ yếu bằng TypeScript. 📝 Performance-first React form state manager with field subscriptions, validation, lists, dependencies, and hook APIs.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
To keep sync with rc-form legacy usage of validator, we still provides callback to trigger validate finished. But in rc-field-form, we strongly recommend to return a Promise instead.
ListOperations
Prop
Type
add
(initValue: any) => void
remove
(index: number) => void
ValidateMessages
Validate Messages provides a list of error template. You can ref here for fully default templates.
Prop
Description
enum
Rule enum prop
len
Rule len prop
max
Rule max prop
min
Rule min prop
name
Field name
pattern
Rule pattern prop
type
Rule type prop
Different with rc-form
rc-field-form is try to keep sync with rc-form in api level, but there still have something to change:
1. Field will not keep snyc with initialValues when un-touched
In rc-form, field value will get from initialValues if user not operate on it.
It's a bug but user use as a feature which makes fixing will be a breaking change and we have to keep it.
In Field Form, this bug will not exist anymore. If you want to change a field value, use setFieldsValue instead.
2. Remove Field will not clean up related value
We do lots of logic to clean up the value when Field removed before. But with user feedback, remove exist value increase the additional work to keep value back with conditional field.
3. Nest name use array instead of string
In rc-form, we support like user.name to be a name and convert value to { user: { name: 'Bamboo' } }. This makes '.' always be the route of variable, this makes developer have to do additional work if name is real contains a point like app.config.start to be app_config_start and parse back to point when submit.
Field Form will only trade ['user', 'name'] to be { user: { name: 'Bamboo' } }, and user.name to be { ['user.name']: 'Bamboo' }.
4. Remove validateFieldsAndScroll
Since findDomNode is marked as warning in StrictMode. It seems over control of Form component.
We decide to remove validateFieldsAndScroll method and you should handle it with you own logic:
Notice: Now if your validator return an Error(message), not need to get error by e => e.message. FieldForm will handle this.
7. preserve is default to false
In rc-form you should use preserve to keep a value cause Form will auto remove a value from Field removed. Field Form will always keep the value in the Form whatever Field removed. But you can still use preserve=false to disable value keeping since 1.5.0.
8. setFields not trigger onFieldsChange and setFieldsValue not trigger onValuesChange
In rc-form, we hope to help user auto trigger change event by setting to make redux dispatch easier, but it's not good design since it makes code logic couping.
Additionally, user control update trigger onFieldsChange & onValuesChange event has potential dead loop risk.
Development
npm install
npm start
npm test
npm run lint
npm run tsc
npm run compile
npm run build
The dumi site runs at http://localhost:8000 by default.
Release
npm run prepublishOnly
The release flow is handled by @rc-component/np through the rc-np command after the package build.
License
@rc-component/form is released under the MIT license.
react-component/field-form thuộc nhóm Frontend trên TopGit, cùng 5 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về react-component/field-form ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/react-component/field-form là nguồn chính thức.
react-component/field-form có bao nhiêu sao?
react-component/field-form có 1.0k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/react-component/field-form. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
react-component/field-form có những chủ đề gì?
GitHub topics của react-component/field-form: "ant-design", "antd", "javascript", "react", "react-component". TopGit xếp repo vào nhóm Frontend.
react-component/field-form có phải mã nguồn mở không?
Có — react-component/field-form phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/react-component/field-form.
react-component/field-form có trang demo không?
Dự án có trang chủ ở https://react-component.github.io/field-form. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
react-component/field-form còn đang phát triển không?
Commit gần nhất trên react-component/field-form là 23 ngày trước (theo timestamp GitHub). Repo có 283 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về field-form?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về field-form.