Here’s the best part: you don’t need to add a build system when you want to use components. Components are always supported in React, no matter how you add it to your website.
-
-
Deze collectie tonen
-
Firefox has built a whole debugger in React without using JSX. So this approach scales quite nicely. Only add a build step when you truly need it — not because a framework demands it!
Deze collectie tonen -
That’s one of the benefits of React approach (components are plain JS), as opposed to a special component format that needs a compiler.
Deze collectie tonen -
But what about JSX? It’s just like adding Sass.https://mobile.twitter.com/dan_abramov/status/1012146082573422592 …
Deze collectie tonen
Einde van gesprek
Nieuw gesprek -
-
-
but should you, though?

-
Whatever works for you. I’m just getting a bit jaded from seeing claims you can’t do that with React, whereas it’s exactly how people have been using it for years since it came out.
-
The documentation actively avoids doing it this way, and points mostly to create-react-app as being The Right Way™
-
Which is why I rewrote it two days ago?
Have you looked at the link?https://reactjs.org/docs/add-react-to-a-website.html … -
If there are more places where a build pipeline is emphasized as a Right Way, please let me know and I'll fix!
-
Interesting! I just realized that when I started out React with the official doc (and some other tutorials), none of them said that using the script tag was a bad practice, but until today, I strongly thought it is!
Brain 
-
Whatever tool you use in the end you’ll end up with a <script> tag. That’s the only way to load code in a browser.
-
This genuinely made give react a try. I’m so tired or these stupid build workflows
Einde van gesprek
Nieuw gesprek -
-
-
Does that mean I can integrate React in an existing website if I have proper state management which can share state between React and non-React code?
-
Sure, that’s exactly how React is used at Facebook and a lot of other places.
-
(meaning we don’t bundle it at FB this way, but we definitely integrate it into a larger site that isn't built with React)
-
Any good articles or guides into integrating React into websites that are not primarily built with it?
-
That would be dope. Always wondered how Facebook uses React, because I know its not used as an SPA.
-
Anything specific you're interested in? I'm not sure what details are missing, but there's nothing special but calling ReactDOM.render() where needed. Some more obscure details are here:https://reactjs.org/docs/integrating-with-other-libraries.html …
-
That is already something, thanks! Not thinking about anything in special, just using React in a page was not meant to use React from the ground up. Since I've started learning React I've only done "full" React applications. Hence the curiosity. Thanks again!
-
I don’t think there are any specific tips other than “call ReactDOM.render” where you need
- Nog 3 antwoorden
Nieuw gesprek -
Het laden lijkt wat langer te duren.
Twitter is mogelijk overbelast of ondervindt een tijdelijke onderbreking. Probeer het opnieuw of bekijk de Twitter-status voor meer informatie.