4 ms·
> you have to give unique id's or smart class names and then find those elements using document.getElementById and attach to it. Having a SPA helps reduce the n
by ngrilly 8y ago
> you have to give unique id's or smart class names and then find those elements using document.getElementById and attach to it. Having a SPA helps reduce the number of named things.
Agreed. It's my biggest gripe with traditional server-side rendered apps versus SPAs.
- mercer 8y agoI don't really get the issue with that. For heavily interactive stuff, sure, you might want to use an SPA and all that this entails. But that's something almost everyone here seems to agree on. But for almost everything less than that, and that probably covers the majority of use cases, you'll have a few dynamic elements on the page, and it's just a matter of ReactDOM.render() + document.getElementById() for the handful of those.