- Create a .gitignore file in the git repository if it does not contain one
touch .gitignore
2. Open up the .gitignore and add the following line to the file
node_modules 3. Remove the node_modules folder from the git repository
/** | |
* useScroll React custom hook | |
* Usage: | |
* const { scrollX, scrollY, scrollDirection } = useScroll(); | |
*/ | |
import { useState, useEffect } from "react"; | |
export function useScroll() { | |
const [lastScrollTop, setLastScrollTop] = useState(0); |