4 ms·
JSX basically compiles down to function calls, so this is more like taking the JSX out of the loop. In react the equivalent JSX would basically compile to
by SahAssar 6y ago
JSX basically compiles down to function calls, so this is more like taking the JSX out of the loop. In react the equivalent JSX would basically compile to
React.createElement("body", {
oncreate: (e) => {
console.log(e, 'was just added to the DOM')
}
}, 'Hello world!'),
which does not seem that different, right?
If you want to you can use JSX with skruv as long as you tell the JSX compiler to use `h` instead, in which case it will produce this:
h("body", {
oncreate: (e) => {
console.log(e, 'was just added to the DOM')
}
}, 'Hello world!'),
which works with skruv.
- madeofpalk 6y agoYes this was kind of my observation.