fix(web): 🐛 resolve react warning re complex var in hook

This commit is contained in:
Collin M. Barrett 2020-09-12 09:58:31 -05:00
parent 08bd76e473
commit b3a51109ce

View file

@ -62,6 +62,7 @@ export const ListInfoDrawer = (props: RouteComponentProps & Props) => {
);
const [originalTitle] = useState<string>(document.title);
const listName = list?.name;
useEffect(() => {
const updateTitle = () =>
(document.title = list?.name + " | " + originalTitle);
@ -69,7 +70,7 @@ export const ListInfoDrawer = (props: RouteComponentProps & Props) => {
return () => {
document.title = originalTitle;
};
}, [list, originalTitle, list?.name]);
}, [list, originalTitle, listName]);
const viewUrl = list?.viewUrls.find(
(u) => u.primariness === 1 && u.segmentNumber === 1
)?.url;