Created
June 25, 2020 12:38
-
-
Save velotiotech/6e38684c0c945bf6ff561bee919fecd0 to your computer and use it in GitHub Desktop.
Cleaner Efficient Code with Hooks and Functional Programming - Fixing Huge Components with hooks - LazyLoader using custom component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from "react"; | |
import { useScroll } from "./useScroll"; | |
const LazyLoader = ({ isLoading, isCompleted }) => { | |
const data = useScroll(); | |
// cDU | |
useEffect(() => { | |
// | |
}, [/** dependencies */]); | |
return data && <div>{data}</div>; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment