Hacker News new | past | comments | ask | show | 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>")

    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 Summer 2019

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