Are we just debating imperative vs declarative UI patterns? I think that debate was settled a long time ago to be fair.
If you happen to like that approach more that’s cool keep using it but it’s not the done thing in any mainstream modern UI framework that I’m aware of for a reason.