3 ms·
Yes, the JSX is compiled (or "transformed") to JavaScript which creates components internally in React: https://babeljs.io/repl/#?experimental=true&evaluate=tr
by lucaspiller 11y ago
Yes, the JSX is compiled (or "transformed") to JavaScript which creates components internally in React:
https://babeljs.io/repl/#?experimental=true&evaluate=true&loose=false&spec=false&code=%20%20%3Csection%3E%0A%20%20%20%20%3Cdiv%3E%3Ch1%3ELatest%20posts%3C%2Fh1%3E%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%3E%0A%20%20%20%20%20All%20my%20posts%0A%20%20%20%20%20%3Cimg%20src%3D%22http%3A%2F%2Fdreamatico.com%2Fdata_images%2Fkitten%2Fkitten-1.jpg%22%20alt%3D%22Kitten%22%20%2F%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fsection%3E https://babeljs.io/repl/#?experimental=true&evaluate=true&lo...
I felt the same as OP when I first started using React, although it makes more sense now I've played with it, I'm still not sure about mixing concerns (code and view) in the same file. Especially when you start talking about CSS too...
https://speakerdeck.com/vjeux/react-css-in-js https://speakerdeck.com/vjeux/react-css-in-js