The old advice was wrong anyway.<p>First, in practice what everybody turned up doing was the inverse (add programming logic inside their HTML).<p>So you still had mixed HTML and JS, but in a way worse way: with ad-hoc and incompatible pseudo-languages (e.g. Angular&#x27;s ng-repeat etc, Knockout&#x27;s template instructions, etc), spiced with &quot;JS inside HTML attributes&quot;, with no syntax checking (a typo could blow your code in runtime) and convoluted to boot.<p>Now, having HTML and logic together makes sense when creating widgets&#x2F;components, as you have all functionality for widget in the same place. After all in every native UI framework you have instructions to draw the widget IN your code -- not as some external additional technology. A widget&#x27;s C&#x2F;C++&#x2F;Obj-C&#x2F;Swift&#x2F;Java&#x2F;C# etc code encapsulates everything about creating it and showing it.<p>So, the better way is to have all your widget drawing depending on external (or internally stored if you must) state, happen inside the widget code itself. Not to try to manipulate a string template by sprinkling ad-hoc instructions like for-each and if-then.<p>And here&#x27;s the better part. React doesn&#x27;t really mix HTML inside JS.<p>JSX might look like doing such, but it&#x27;s just sugar for calling Javascript functions. &lt;div&gt; is essentially something like: React.createElement(null, &quot;div&quot;); So, the &quot;HTML&quot; is just calls to DOM manipulation methods.<p>So, with React there&#x27;s just JS, and it handles all the creation of the HTML code for a &quot;component&quot; (widget). It&#x27;s also composable, so your panel is just a components embedding other components.