by morrvs · 6y ago · 0 comments
A couple possible problems off the top of my head:
1. CSS transitions won't work if you re-render a complete chunk of HTML instead of toggling a class.
2. <a>, <button>, <input>, etc. may lose focus or even data on re-render (e.g. while filling out a form).
3. Text selection may be reset on re-render.
4. If you don't use event delegation, event listeners may need to be reattached.
I agree that for raw display .innerHTML may be sufficient, but it's surely not in general. That would make React almost irrelevant, by the way, which would be a huge surprise.
No comments yet.