Preact
Due to implementing a nearly identical API, there is no separate Preact filter. Instead, the React filter also enables you to build Preact components.
When a class definition is encountered that derives from either Preact
or
Preact::Controller
, all of the transformations defined by the React
filter will be applied with the following differences:
-
An
import
statement for Preact will be generated -
Preact.h
and more simplyh
calls can be used to create elements. The JSX-like syntax as well as the Wunderbar syntax. continue to be supported, and will generatePreact.h
calls and references toPreact.Fragment
as needed. -
onInput
instead ofonChange
functions are automatically generated for controlled components. For compatibility,onChange
attributes on these elements will be replaced withonInput
. -
For compatibility,
onDoubleClick
attributes will be mapped toonDblClick
attributes.className
attributes will be mapped toclass
attributes.htmlFor
attributes will be mapped tofor
attributes.
For more information, see the examples provided.