Skip to content
This repository was archived by the owner on Jul 9, 2019. It is now read-only.

Form Input components compliance

Tushar Singh edited this page Sep 14, 2016 · 1 revision

Form Input components

For your Input components to be compatible with <Form />

Component must have a stateless version via stateless prop Any given Input component must have two versions. By default it should be able to operate independently, managing state internally.

But it should also be able to work in a stateless manner – This doesn't necessarily mean you can't manage state internally; It just means new value will be passed to component as prop and changes will go back to Form component using onChange prop (think of Form as your state store)

hint: use componentWillReceiveProps hook to update internal state if you must maintain one

Clone this wiki locally