This only works for simple cases. Where this breaks down is when you have to inspect the current state of the DOM before deciding what changes to make to it. Example: scroll an element into view if it is not already visible. More examples: drag & drop, interactive resize, etc.
For example, in vanilla JS, you might have something like:
In React instead: I find it simpler to understand, because render, given its state, describes exactly how the UI should be.