Closed AlexanderTheGrape closed 4 years ago
There's just one remaining linting issue I haven't been able to change so far. It says "React Hook useEffect has a missing dependency: 'setTheme'.", but when I import setTheme, the import doesn't get used. If any reviewers have a suggestion, please let me know!
There's just one remaining linting issue I haven't been able to change so far. It says "React Hook useEffect has a missing dependency: 'setTheme'.", but when I import setTheme, the import doesn't get used. If any reviewers have a suggestion, please let me know!
So I looked into it, and it appears that the code causing the build to fail is:
useEffect(() => {
const fetchTasks = async () => {
const tasks = await DotoService.getTasks();
setTasks(tasks);
};
const fetchUserInfo = async () => {
const userInfo = await DotoService.getUserInfo();
setTheme(userInfo.themePreference);
};
fetchUserInfo();
fetchTasks();
}, []);
This little code snippet is from doto-frontend/src/components/pages/Calendar/Calendar.js
. The reason that the build is failing is because of the empty array after the anonymous function. As in;
useEffect(()=>{...}, [])
That second argument is causing the build to fail. So, try removing it. It's a little strange because this file wasn't actually changed by your PR, but maybe if this works then your PR can fix it.
Cheers Matt, I've made that change and works as expected.
issue/162 - Prevent access to calendar and settings page and redirect when not logged in