mauricenino / react-form-ctl Goto Github PK
View Code? Open in Web Editor NEWA way of validating forms in React, inspired by Angular's FormControl
License: MIT License
A way of validating forms in React, inspired by Angular's FormControl
License: MIT License
Currently, usage tests are in one big file. It would be better to split them up, so they can be maintained easier.
There should be a method exposed, to easily reset the form to the given initial values, like so:
const {reset} = useFormControl<any>({
// define initial values
});
// called later
reset();
On every re-render, the hook returns a new instance for the value properties.
This causes bad performance and endless loops.
e.g.
const settings = useAppSelector(selectSettings);
const dispatch = useAppDispatch();
const { controls, value } = useFormControl<AppSettings>({
syncEnabled: [true],
syncOverMobile: [false],
syncIntervalSec: [4 * 60 * 60] // 4 hours
});
// updates internal value, when settings value (reference) changes
useEffect(() => {
dispatch(settingsActions.set(value as AppSettings));
}, [value, dispatch]);
A solution would be for example to be able to pass a dependency array to the hook call
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.