Skip to content
Jason Miller edited this page Jan 27, 2016 · 5 revisions

Forms in Preact work much the same as they do in React, except there is no support for the "static" (faked initial value) props/attributes.

React Forms Docs

React's documentation on "Controlled" Components and "Uncontrolled" Components is immensely useful in understanding how to take HTML forms, which have bidirectional data flow, and make use of them from the context of a Component-based Virtual DOM renderer, which generally has unidirectional data flow.

Generally, you should try to use Controlled Components at all times. However, when when building standalone Components or wrapping third-party UI libraries, it can still be useful to simply use your component as a mount point for non-preact functionality. In these cases, "Uncontrolled" Components are nicely suited to the task.

Docs have moved!

Clone this wiki locally