Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cleaner Efficient Code with Hooks and Functional Programming - Fixing Huge Components with hooks - LazyLoader using custom component
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