UNPKG

react-scrollsyx

Version:

An ambitious light-weight react module written in TypeScript for tracking scroll progress in a performant way. Developed for use with spring based animation libraries such as react-spring, but can be used with or without any library.

2 lines (1 loc) 793 B
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e["react-scrollsyx"]={},e.jsxRuntime,e.React))})(this,function(e,n,u){"use strict";function i(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const c=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r,o,c.get?c:{enumerable:!0,get:()=>t[o]})}}return r.default=t,Object.freeze(r)}const s=i(u),f=()=>{const[t,r]=s.useState(0);return n.jsxs("button",{onClick:()=>r(t+1),children:["Click me ",t]})};e.Button=f,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});