4 ms·
Regarding the hack to make function calls: if JSX elements start with a capital letter, then the pragma is ignored, and the element name is used as a local vari
by DougBTX 11y ago
Regarding the hack to make function calls: if JSX elements start with a capital letter, then the pragma is ignored, and the element name is used as a local variable name instead, e.g.:
transform("<Foo id = 'my-element'>hi!</Foo>")
outputs
Foo({id: "my-element"}, ["hi!"])
- tolmasky 11y agoYeah, it was outside the scope of this blog post, but if you look at how its implemented here: https://github.com/tolmasky/generic-jsx/blob/master/generic-jsx.js#L9 https://github.com/tolmasky/generic-jsx/blob/master/generic-... you'll see it deals with both cases.