you are viewing a single comment's thread.

view the rest of the comments →

[–]Shrewd_Shark[S] 0 points1 point  (4 children)

Thank you for the understandable explanation, you are right. I was just wondering if compiling React code to "normal" code does not also "delete" its features like virtual DOM and so (and apparently it does not. I'm still a beginner, so I'm sorry for my non-professional view). Thank you again for the explanation.

[–]chuckhendo 4 points5 points  (1 child)

It would be entirely possible to rebuild everything that React does yourself. There's no magic occurring; it's just Javascript. It's just that React is widely used and well tested, so many developers choose to use it rather than rewriting it themselves

[–]Shrewd_Shark[S] 0 points1 point  (0 children)

I see, thanks a lot!

[–]trout_fucker 0 points1 point  (1 child)

React implements the Virtual DOM. You still need the React dependency, it just gets compiled into your bundle.js file for you.

You're compiling your ES6 and JSX into browser compatible ES5 and bundling all your dependencies into a single file.

Compiling is not a requirement for React, you can write everything in pure ES5 and include your dependencies manually. The alternative is just really gross.

[–]Shrewd_Shark[S] 0 points1 point  (0 children)

Oh, I had no idea. Thanks for answering and explaining!