@reasonbr/reform

Reasonably making forms with ReScript and React sound good


Keywords
reason, bucklescript, react, form, rescript, rescript-react, rescript-forms, rescript-react-forms, rescript-reform, reform, forms, react-form, reasonml, rescript-react-form, typed-form
License
MIT
Install
npm install @reasonbr/reform@11.0.0-alpha.1

Documentation

All Contributors npm version


Documentation โ€ข Installation โ€ข Getting started โ€ข Live demo


Installation ๐Ÿ“ฆ

yarn add @rescriptbr/reform @rescriptbr/reschema

Then add it to bsconfig.json

"bs-dependencies": [
 "@rescriptbr/reform",
 "@rescriptbr/reschema"
]

Then add lenses-ppx

yarn add lenses-ppx -D

And update your bsconfig.json with ppx-flags

"ppx-flags": [
 "lenses-ppx/ppx"
]

Why? ๐Ÿ’ก

As you might know, you can use any existing React / JavaScript libraries with ReScript, including form libraries like Formik, react-hook-form, Final Form, since you install or create bindings for these libraries. ReForm is not a set of bindings for an existing form library, it was created from scratch to use with ReScript and React.

Code that deals with strongly typed forms can quickly become walls of repeated text. We created ReForm to be both deadly simple and to make forms sound good leveraging ReScript's powerful typesytem. Even the schemas we use are nothing more than constructors built-in in the language itself with a small size footprint.

Features โšก

  • Hook API
  • Schema API
  • Type safe, handleChange properly infers the value of the field it is handling
  • Context Provider
  • Field component
  • Validation strategy, OnDemand and OnChange

Alternatives ๐Ÿ”ฅ

Support ๐Ÿš€

๐ŸŒ We usually hang out at https://forum.rescript-lang.org/ so feel free to ask anything there.

๐Ÿ‡ง๐Ÿ‡ท ๐Ÿ‡ต๐Ÿ‡น Se vocรช รฉ Brasileiro, Portuguรชs ou fala portuguรชs, vocรช pode entrar contato atravรฉs do discord do ReScriptBR.

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Thomas Deconinck

๐Ÿ“– ๐Ÿ’ป

Gabriel Rubens

๐Ÿ’ป ๐Ÿ› ๐Ÿค” ๐Ÿ–‹ ๐Ÿ“–

Lucas Besen

๐Ÿšง

Jefferson Carvalho

๐Ÿ’ป

Luiz Augusto Moratelli

๐Ÿ’ป

amythos

๐Ÿ’ป

Lalli Nuorteva

๐Ÿ›

Matt

๐Ÿšง

Kyle Davis

๐Ÿ‘€

Ulugbek Abdullaev

๐Ÿ›

Khoa Nguyen

๐Ÿ’ป

Medson Oliveira

๐Ÿ’ป ๐Ÿค”

Ana Luiza Portello Bastos

๐Ÿ“–

Freddy Harris

๐Ÿ›

arthur

๐Ÿ“– ๐Ÿ’ป

Marcos Oliveira

๐Ÿ“– ๐ŸŽจ

Celso Bonutti

๐Ÿ’ป

Jason Smythe

๐Ÿ’ป ๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!