3 ms·
There are even alternative syntaxes: https://github.com/lantiga/react.hiccup https://github.com/lantiga/react.hiccup https://github.com/ForbesLindesay/react-j
by aeosynth 12y ago
There are even alternative syntaxes:
https://github.com/lantiga/react.hiccup https://github.com/lantiga/react.hiccup
https://github.com/ForbesLindesay/react-jade https://github.com/ForbesLindesay/react-jade
- twfarland 12y agoI have found it easy enough to just use json-serializable literals to represent html, e.g: ['div', {id: 'main'}, ['h1', 'Some title'], ['p', 'Some text']] I wrote a little function to turn this kind of thing into an html string (https://github.com/twfarland/don https://github.com/twfarland/don), but it could also be used as the view descriptor for some kind of view component ala React. Might work on that...
- wbkang 12y agoI like this a lot. I actually used this at work. With a simple function to translate JSON into DOM incrementally, it's a lot more succinct than JSX. And it's fully programmable in JS.