-
-
Replying to @threepointone
very cool! hmm, i wonder why they went with this $(tag, props) syntax instead of JSX! cos then i could basically plug and play any of my existing components...
3 replies 0 retweets 4 likes -
Replying to @swyx @threepointone
I believe because
@lynaghk is Clojurist (in Clojure there's a different syntax for components) and it seems like the tool itself is written in ClojureScript3 replies 0 retweets 2 likes -
It's not Clojure, it's JS: const $ = function(){ [a, b, ...rest] = arguments; if(('object' === typeof b) && !(React.isValidElement(b))){ return React.createElement.apply(null, arguments); }else{ return React.createElement.apply(null, [a, {}, b].concat(rest)); } }
2 replies 0 retweets 3 likes -
Replying to @lynaghk @roman01la and
I just wanted a terse syntax so it'd be faster to type out markup. Totally open to supporting JSX (or other React templates) --- only reason it's not in there now is because I couldn't understand Babel or NPM well enough to create an `eval_with_jsx` function.
2 replies 0 retweets 2 likes -
Is it open source? I could sketch a quick PR to add JSX support
1 reply 0 retweets 0 likes
Thanks for the offer! A minimal example repo on github or even a codepen (if that's even possible?) would be nicer, since that'd be more accessible to others who might want a minimal-jsx-expansion function.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.