1.0.0 • Published 3 years ago

@ian_test_nooks/use-scroll v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@ian_test_nooks/use-scroll

React Hook to check scroll position when slide scroll

npm i @ian_test_nooks/use-scroll

const { current X, current Y } = useScroll(offsetX, offsetY);

import useScroll from "@ian_test_nooks/use-scroll";

const App = () => {
  const { x, y } = useScroll(offsetX, offsetY);
  return (
    <div className="App" style={{ height: "1000vh" }}>
      <h1 style={{ position: "fixed", color: y > 100 ? "red" : "green" }}>
        hello
      </h1>
    </div>
  );
};