Hacker News new | comments | show | ask | jobs | submit login

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!"])



Yeah, 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-... you'll see it deals with both cases.




Applications are open for YC Winter 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: