The Pitfalls of Creating Components Inside the Body Function of a React Component
How creating a component inside the component function definitions can cause problems in app development, and how to avoid it by using an external or memoized component.