fix(shareModal/index.tsx): update useEffect dependency array to include 'open' variable to prevent unnecessary re-renders

This commit is contained in:
anovazzi1 2023-11-21 22:29:23 -03:00
commit e8783d3a9b

View file

@ -45,9 +45,11 @@ export default function ShareModal({
const [unavaliableNames, setUnavaliableNames] = useState<string[]>([]);
useEffect(() => {
handleGetTags();
handleGetNames();
}, []);
if (open) {
handleGetTags();
handleGetNames();
}
}, [open]);
function handleGetTags() {
setLoadingTags(true);