oskarkook / proxy-form Goto Github PK
View Code? Open in Web Editor NEWEasy React form state management with the help of JS proxies
License: MIT License
Easy React form state management with the help of JS proxies
License: MIT License
It would be good if the library could support or provide examples of using reducers for form updates. This can be useful in some more complicated use-cases.
Should be named getRawForm()
in this case.
Should provide some easy integration for validation and errors. Take a look at react-hook-form
for inspiration.
It causes issues with Typescript that are difficult to resolve. A replacement could be to allow the following:
field(prepareMyField(form.myField))
However, this would require that we check correct useForm()
usage through call stack tracing. See #4 (comment)
field()
is called, it checks that the identifier of the field is the same as the last accessCould use the yup API docs as an influence: https://github.com/jquense/yup#api
Similar to changed fields, but instead is registered whenever user interacts (focuses) the field.
Either expose an onSubmit()
function, or just expose the getForm()
function. The latter seems better to me, would also be helpful in some edge cases.
The getForm()
function should be renamed to getValues()
or something. It would match up with the defaultValues
option and would be clear that it's not a proxy that you're receiving.
When a deletion or swap in an array happens, Immer produces the following patches:
replace
patchlength
element is patchedreplace
patch with the next element as the new valuePossibly, the following patches should be emitted instead:
move
operation as described in the JSON patch RFCremove
operation on the last element of the arrayremove
operation on the given element of the arrayNeed to write a large number of tests to ensure correctness.. ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.