Right, but the point is that React is disciplined for you. You never do any manual HTML manipulation so you don't have to worry about injection issues.
React doesn't require you to ever manually replace a component - that's why the two are not comparable.