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
importstatement for Preact will be generated -
Preact.hand more simplyhcalls can be used to create elements. The JSX-like syntax as well as the Wunderbar syntax. continue to be supported, and will generatePreact.hcalls and references toPreact.Fragmentas needed. -
onInputinstead ofonChangefunctions are automatically generated for controlled components. For compatibility,onChangeattributes on these elements will be replaced withonInput. -
For compatibility,
onDoubleClickattributes will be mapped toonDblClickattributes.classNameattributes will be mapped toclassattributes.htmlForattributes will be mapped toforattributes.
For more information, see the examples provided.