Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@studio-freight/react-lenis
Advanced tools
react-lenis provides a <ReactLenis>
component that creates a Lenis instance and provides it to its children via context. This allows you to use Lenis in your React app without worrying about passing the instance down through props. It also provides a useLenis
hook that allows you to access the Lenis instance from any component in your app.
For npm users:
npm i @studio-freight/react-lenis
For yarn users:
yarn add @studio-freight/react-lenis
import { ReactLenis, useLenis } from '@studio-freight/react-lenis'
function Layout() {
const lenis = useLenis(({ scroll }) => {
// called every scroll
})
return (
<ReactLenis root>
{ /* content */ }
</ReactLenis>
)
}
options
: Lenis options.root
: Lenis will be instanciate using <html>
scroll. Default: false
.autoRaf
: if false
, lenis.raf
needs to be called manually. Default: true
.rAFpriority
: Tempus execution priority. Default: 0
.Once the Lenis context is set (components mounted inside <ReactLenis>
) you can use these handy hooks:
useLenis
is a hook that returns the Lenis instance
The hook takes three argument:
callback
: The function to be called whenever a scroll event is emitteddeps
: Trigger callback on changepriority
: Manage callback execution orderGSAP integration
function Component() {
const lenisRef = useRef()
useEffect(() => {
function update(time) {
lenisRef.current?.raf(time * 1000)
}
gsap.ticker.add(update)
return () => {
gsap.ticker.remove(update)
}
})
return (
<ReactLenis ref={lenisRef} autoRaf={false}>
{ /* content */ }
</ReactLenis>
)
}
microbundle
after running build:bundled
script. Includes all external dependencies.microbundle
after running build:dist
script.
tsc
after running build:types
script.vite
through dev
script to serve the documentation.This tool is maintained by the Studio Freight Darkroom team:
FAQs
![NPM Version](https://img.shields.io/npm/v/%40studio-freight%2Freact-lenis?colorA=000000&colorB=ff98a2) ![NPM Downloads](https://img.shields.io/npm/dm/%40studio-freight%2Freact-lenis?colorA=000000&colorB=ff98a2)
The npm package @studio-freight/react-lenis receives a total of 7,996 weekly downloads. As such, @studio-freight/react-lenis popularity was classified as popular.
We found that @studio-freight/react-lenis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.