@am-hooks/use-scroll

1.0.0 • Public • Published

useScroll

스크롤 사용할 때 감지

Installation

yarn

yarn add @am-hooks/use-scroll

npm

npm i @am-hooks/use-scroll

Usage

import React from "react";
import useScroll from "@am-hooks/use-scroll";

const App = () => {
  const { y } = useScroll();

  return (
    <div className="App" style={{ height: "500vh" }}>
      <h1
        style={{
          position: "fixed",
          color: y > 100 ? "red" : "blue"
        }}
      >
        Hello
      </h1>
    </div>
  )
}



Package Sidebar

Install

npm i @am-hooks/use-scroll

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

1.66 kB

Total Files

4

Last publish

Collaborators

  • wam-6577