I want to Load Skeleton 10 times before data totally fetched from API in react.js with the following code, but the skeleton not loading...
const snippetsdata = snippetsData.data;;
const [snippets, setSnippets] = useState([]);
const [loading, setLoading] = useState(false);
useEffect(() => {
setLoading(true);
const timer = setTimeout(() => {
setSnippets(snippetsdata);
setLoading(false);
}, 3000);
return () => clearTimeout(timer);
}, []);
{loading && Array(10).map(()=>{
<SnippetsSkeleton />
})}