We always have the option to define data in a component or outside of it. Create methods outside of a component unless they're directly tied to its logic. In the case of functional components, everything gets re-created when the body re-renders. That can especially cause issues if you pass the data further down as props.