How to change UI in a declarative framework

Consider a simplified example below:

In the imperative style, you would typically go to ViewB’s owner
and retrieve the instance b using selectors or with findViewById or similar,
and invoke mutations on it (and implicitly invalidate it). For example:

// Imperative style

setColor

red

clearChildren

()

ViewC

c3

new

ViewC

(...)

add

c3

You might also need to replicate this configuration in the constructor of
ViewB since the source of truth for the UI might outlive instance b itself.