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 simply h calls can be used to create elements. The JSX-like syntax as well as the Wunderbar syntax. continue to be supported, and will generate Preact.h calls and references to Preact.Fragment as needed.

  • onInput instead of onChange functions are automatically generated for controlled components. For compatibility, onChange attributes on these elements will be replaced with onInput.

  • For compatibility,

    • onDoubleClick attributes will be mapped to onDblClick attributes.
    • className attributes will be mapped to class attributes.
    • htmlFor attributes will be mapped to for attributes.

For more information, see the examples provided.

Next: Require