Reusing the Widgets of Model View Intent

Learn to use the widgets of MVI that have already been implemented, such as the search input box.

As we make more complex applications, we’ll want to reuse some of their UI components. Our Wikipedia search application is not suitable for this example, but it already has a couple of components that could be reused in other applications. For example, we could definitely make the search input box into a widget of its own.

The objective here is to encapsulate our widget in its own component so that we can use it as any other DOM element. If we succeed, we should also be able to parameterize the component with any properties we want. After encapsulating the widget in its own component, we’ll use it in our applications like this:

Get hands-on with 1200+ tech skills courses.