Ne déclenchez pas d'utilisation Effecte au démarrage
Refer
https://stackoverflow.com/a/71342621/15187131
// Or use useLayoutEffect
const firstUpdate = useRef(true);
useLayoutEffect(() => {
if (firstUpdate.current) {
firstUpdate.current = false;
} else {
// do things after first render
}
});
shahul