In simple or basic apps it’s easy to nest widgets,
but as the code base gets larger and the app becomes complex,
you should break deeply nested widgets into
functions that return the widget or smaller classes.
Creating separate functions
and widgets allows you to reuse the components within the app.

How do I create reusable components?

In React Native, you would define a class to create a
reusable component and then use props methods to set
or return properties and values of the selected elements.
In the example below, the CustomCard class is defined
and then used inside a parent class.

// React Native

class

CustomCard

extends

React

Component

render

()

return

View

Text

Card

this

props

index

/Text

Button