Commit 96589f40 authored by Paul Kaplan's avatar Paul Kaplan

Comment the useEffect usage

parent f40f3fa7
...@@ -10,9 +10,12 @@ import Debug from './debug.jsx'; ...@@ -10,9 +10,12 @@ import Debug from './debug.jsx';
const StudioActivity = ({items, loading, error, onInitialLoad}) => { const StudioActivity = ({items, loading, error, onInitialLoad}) => {
const {studioId} = useParams(); const {studioId} = useParams();
// Fetch the data if none has been loaded yet. This would run only once,
// since studioId doesnt change, but the component is potentially mounted
// multiple times because of tab routing, so need to check for empty items.
useEffect(() => { useEffect(() => {
if (studioId && items.length === 0) onInitialLoad(studioId); if (studioId && items.length === 0) onInitialLoad(studioId);
}, [studioId]); }, [studioId]); // items.length intentionally left out
return ( return (
<div> <div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment