react-formularium
v0.2.0
Published
A simple lib for handle forms in React.
Downloads
3
Maintainers
Readme
React formularium
The React Formularium is a library under development that aims to be a simple and efficient solution for form management. It stands out for using native JavaScript data structures to save, update, and retrieve data, making it lightweight and performant.
Key Features:
- Simplicity: The library offers an intuitive and easy-to-use API, ideal for beginners and experienced developers.
- Efficiency: The use of native JavaScript data structures ensures superior performance and optimizes resource usage.
- Flexibility: React Formularium is compatible with different types of forms and can be easily integrated into other projects.
- Extensibility: The library provides customizable hooks that allow you to adapt the form's behavior to your specific needs.
Therefore, to save the form data, you could do the following:
const { data: formData } = useForm<Type of data>(initialdataObj);
<TextInput
name="title"
placeholder="Digite o titulo do anuncio"
onChangeText={value => formData.set('title', value)}
/>
To get individual data:
const title = formData.get(title)
The function submitForm return all data as parameter to the callback function.
const onSubmit = async (formData: T) => {
console.log(formData) // log an object with all form data
}
submitForm(onSubmit, rules)