🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

react-scroll-sticky

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-scroll-sticky

react scroll sticky like 'side bar: about' in fb profile home

1.1.2
latest
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

react-scroll-sticky

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save react-scroll-sticky

Usage

//
const App = () => {
  //
  const { calculateAgain, ref_main_elm, ref_sticky_elm, ref_fake_elm } =
    useScrollSticky({
      sticky_location: /./,
      header_head: 0,
      detectInnerWidthIsOk: detectInnerWidthIsOk
    })

  //
  React.useEffect(() => {
    calculateAgain()
  }, [calculateAgain])

  // ----

  //
  function detectInnerWidthIsOk() {
    return true
  }

  //
  return (
    <div className={styles.main}>
      <div className={styles.row}>
        <div className={`${styles.left}`}>
          <ScrollSticky
            ref_main_elm={ref_main_elm}
            ref_fake_elm={ref_fake_elm}
            ref_sticky_elm={ref_sticky_elm}
          >
            <div className={styles.preview}>
              <div>1</div>

              <div>2</div>

              <div>3</div>

              <div>4</div>
            </div>
          </ScrollSticky>
        </div>

        <div className={`${styles.right}`}></div>
      </div>
    </div>
  )
}

License

MIT ©

FAQs

Package last updated on 02 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts