react-jayform

rails-like forms with form objects for react

Usage no npm install needed!

<script type="module">
  import reactJayform from 'https://cdn.skypack.dev/react-jayform';
</script>

README

React Forms and Form Objects

  • inspired by Ruby on Rails forms (FormHelper/SimpleForm) and form objects (reform)
  • works well with a rails backend, but it's not necessary
  • uses Redux for state updates, but you don't have to

Installlation

npm install react-jayform

Usage

import jayform from 'react-jayform'

Features for Ruby on Rails Interaction

  • if an authenticity_token is given or state.authenticity_token is defined, a hidden field providing it will be generated
  • if a method other than GET or POST is provided, a hidden _method field will be generated
  • if you are using i18n-jsand/or provide a global I18n object, react-jayform will search it for translations

License

MIT