Typically, domain models and UI views are completely separated. A few years ago, we had a good reason to do so because the views were mostly made of imperative code. But now that we have functional UI libraries (e.g., React with hooks), wouldn’t it be possible to gather everything together, and implement the views as methods of the models they represent?
I have two points:
You can create a functional component called UserLayout, to separate the layout, and then, return that in the View function.
and… How you intent to create the User object? If you load data from http (axios, or directly) you have no formal objects, only anonymous objects, lists and attributes.
To manage layouts, I guess you can do as you said, but I would prefer to implement the layouts in some static methods of the