drfrf
Django REST framework - redux-form connector
Installation
$ yarn add drfrf
Usage
Compose the drfrf
higher-order component with reduxForm
:
const App = <form>...</form> App
To-daa! Your form automatically queries the specified endpoint with every onChange and displays errors from the backend! 🎉
Browse the complete example here: https://github.com/Theodo-UK/drfrf/tree/master/example/frontend/src
API
drfrf
exposes a single HOC which sets the asyncValidate
prop for redux-form to use.
This HOC accepts a configuration object with the following properties:
name | default | description |
---|---|---|
endpoint | none | URL to call with every change |
method | "POST" | HTTP method to use |
Backend integration
If you're using Django in your backend, check out drfrf for the backend.