Skip to content

Commit

Permalink
try fix #30 (#31)
Browse files Browse the repository at this point in the history
This ensures `<input>` gets rendered first before `input?.addEventListener` gets called
  • Loading branch information
phanirithvij authored Sep 17, 2021
1 parent b038325 commit 36fea37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/screens/manga/MangaExtensions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default function MangaExtensions() {
document.removeEventListener('dragover', dragOverHandler);
input?.removeEventListener('change', changeHandler);
};
}, []);
}, [extensions]); // useEffect only after <input> renders

if (Object.entries(extensions).length === 0) {
return <h3>loading...</h3>;
Expand Down

0 comments on commit 36fea37

Please sign in to comment.