Open nippur72 opened 8 years ago
+1 native preact support would be great. @nippur72, have you checked if react-templates works with preact-compat?
@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
.
Preact is a React clone that is gaining popularity. With minimal changes,
react-templates
might be modified to supportpreact
as a target different than React or React native.From my early experiments the changes needed are:
React.createElement
. That is already implemented in PR #176 with the new command line option--create-element-alias
.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 arefunction(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
.