fix(shareModal/index.tsx): update useEffect dependency array to include 'open' variable to prevent unnecessary re-renders
This commit is contained in:
parent
d4cef3588c
commit
e8783d3a9b
1 changed files with 5 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue