-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Forms
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'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.
Notice: All documentation has moved to preactjs.com →