Do all components needs to be instantiated in the MainView?

When instantiating components like TextField() and Button() do they have to be in the MainView file? I’m trying to call methods on these components using another class from another file and calling those said classes in the MainView. However my web application will end up blank as if I had nothing in the file. Is there a way to this from outside of the MainView?

What are you defining as the MainView? Is that some sort of wrapper view that is providing tab links or something like that? Typically you would define those components in each separate view that you are creating and they should render fine as long as you are using a Layout and adding the components to the Layout (Horizontal, Vertical etc.)