Skip to content

support "preact" #180

@nippur72

Description

@nippur72

Preact is a React clone that is gaining popularity. With minimal changes, react-templates might be modified to support preact as a target different than React or React native.

From my early experiments the changes needed are:

  • ability to use a different name than React.createElement. That is already implemented in PR #175, #179, #135, #93, #183, #184, #191, fix broken html tests, fix broken --react-import-path #176 with the new command line option --create-element-alias.
  • pass props, state to the render function. This is one of the few differences between preact and react (and is optional too). The change should be easy since we already do something similar for stateless functions (which are function(props, context)).

As for how to enable the preact syntax, I am for using the already existing --target-version, by simply telling --target-version preact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions