I'm learning remix and I'd have some functions in my loader that I call in my default route with useLoaderData like so :
export const loader = async () => {
const pokemon = await getRandomPokemon();
const types = await getAllPokemonTypes();
return [pokemon, types.results];
};
export default function App() {
const [pokemon, types] = useLoaderData();
...
}
I'd like to add a button to reload data (since I want a new random pokemon in this case) everytime I click on it