handleSubmit is a method and messages is a ref().useState to be able to call handleSubmit and access messages from any component and keep the state alive on route change?Join the Discord to ask follow-up questions and connect with the community