Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support "preact" #180

Open
nippur72 opened this issue Aug 15, 2016 · 2 comments
Open

support "preact" #180

nippur72 opened this issue Aug 15, 2016 · 2 comments

Comments

@nippur72
Copy link
Contributor

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.

@motin
Copy link

motin commented Jan 16, 2017

+1 native preact support would be great.
@nippur72, have you checked if react-templates works with preact-compat?

@nippur72
Copy link
Contributor Author

@motin I initially checked it when testing my PR, and if I remember correctly there were no problems. Of course the PR is to use preact without preact-compact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants