You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You get cryptic output (empty array) and nothing happens. This caused me an hour or two of confusion, and I tried checking the docs and eventually just read the source for jsx, saw it uses commoner, and found out from further digging:
Turns out jsx requires the input files to have a .js extension (rather than .jsx).
I think it might help people to put a short section in the docs on how to integrate jsx into your build.
In short, and correct me if I'm wrong:
JSX files should be end in .js, not in .jsx
Use jsx src/ dst/ to compile a folder full of JSX files to plain JS
The /** @jsx React.DOM */ comment is no longer required and has no effect
If you're using Browserify, you don't have to use jsx at all, just use --reactify
Thoughts?
The text was updated successfully, but these errors were encountered:
Would probably be a good idea to add a info/notice/warning if the transpiler notices some .jsx files but isn't converting them, since a user probably intended to have the devtools convert their jsx files. #goodfirstbug
PS: Hey DC! Glad to see you're using React! We should go do the dish run again some time, I'd be curious to hear how your web-based gpg client is going!
I ran into an issue where the
jsx
command-line build tool wouldn't build a folder full of.jsx
files.You get cryptic output (empty array) and nothing happens. This caused me an hour or two of confusion, and I tried checking the docs and eventually just read the source for
jsx
, saw it usescommoner
, and found out from further digging:Turns out
jsx
requires the input files to have a.js
extension (rather than.jsx
).I think it might help people to put a short section in the docs on how to integrate
jsx
into your build.In short, and correct me if I'm wrong:
jsx src/ dst/
to compile a folder full of JSX files to plain JS/** @jsx React.DOM */
comment is no longer required and has no effectjsx
at all, just use--reactify
Thoughts?
The text was updated successfully, but these errors were encountered: