{"_id":"@mapbox/scroll-restorer","_rev":"201-31330e7cf54d8c8bc8df8e20ffef3a42","name":"@mapbox/scroll-restorer","description":"Preserve scroll state while navigating client-side routes","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"@mapbox/scroll-restorer","version":"0.1.0","description":"Preserve scroll state while navigating client-side routes","main":"index.js","scripts":{"precommit":"lint-staged","format":"prettier --single-quote --write '{,test/**/}*.js'","lint":"eslint .","start-example-app":"webpack-dev-server --config ./example/webpack.config.js --content-base ./example","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/mapbox/scroll-restorer.git"},"keywords":["scroll-restoration","scroll","restore","routing","router"],"author":{"name":"Mapbox"},"license":"MIT","bugs":{"url":"https://github.com/mapbox/scroll-restorer/issues"},"homepage":"https://github.com/mapbox/scroll-restorer#readme","devDependencies":{"babel-core":"^6.25.0","babel-eslint":"^7.2.3","babel-loader":"^7.1.1","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint":"^4.1.1","eslint-plugin-react":"^7.1.0","husky":"^0.14.1","jest":"^20.0.4","lint-staged":"^4.0.0","prettier":"^1.5.2","prop-types":"^15.5.10","react":"^15.6.1","react-dom":"^15.6.1","react-router-dom":"^4.1.1","webpack":"^3.0.0","webpack-dev-server":"^2.5.0"},"jest":{"coverageReporters":["json","lcov","text","html"],"resetMocks":true,"roots":["./test"],"testRegex":".*\\.test\\.js$"},"lint-staged":{"{,test/**/}*.js":["eslint","prettier --single-quote --write","git add"]},"dependencies":{"debounce":"^1.0.2","xtend":"^4.0.1"},"gitHead":"edff9384109eb39a04f5590ade228fb153c3edce","_id":"@mapbox/scroll-restorer@0.1.0","_shasum":"78412dba58a58f2a2ca187c891894a096c6d158d","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"johnfurrow","email":"hello@johnfurrow.com"},"dist":{"shasum":"78412dba58a58f2a2ca187c891894a096c6d158d","tarball":"https://registry.npmjs.org/@mapbox/scroll-restorer/-/scroll-restorer-0.1.0.tgz","integrity":"sha512-31+Au06Ep3kxMLyeVWIZs7dpselVO66T9JIZLEwKo1mXTqo6W0FxZxudXCy3BZCF1UH3BbMo4Z0ZCg5Yncdnyw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9DMChsnHmcxMqFoILnvnCAGYoLOwnZukoO9uqOITQrQIhAPV2rLQjq7hYNIWIuJ0jUTWol4FI4Haf05na1Gfbbr+M"}]},"maintainers":[{"name":"johnfurrow","email":"hello@johnfurrow.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scroll-restorer-0.1.0.tgz_1499381307727_0.9188319114036858"},"directories":{}},"1.0.0":{"name":"@mapbox/scroll-restorer","version":"1.0.0","description":"Preserve scroll state while navigating client-side routes","main":"index.js","scripts":{"precommit":"lint-staged","format":"prettier --single-quote --write '{,test/**/}*.js'","lint":"eslint .","start-example-app":"webpack-dev-server --config ./example/webpack.config.js --content-base ./example","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/mapbox/scroll-restorer.git"},"keywords":["scroll-restoration","scroll","restore","routing","router"],"author":{"name":"Mapbox"},"license":"MIT","bugs":{"url":"https://github.com/mapbox/scroll-restorer/issues"},"homepage":"https://github.com/mapbox/scroll-restorer#readme","devDependencies":{"babel-core":"^6.25.0","babel-eslint":"^7.2.3","babel-loader":"^7.1.1","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint":"^4.1.1","eslint-plugin-react":"^7.1.0","husky":"^0.14.1","jest":"^20.0.4","lint-staged":"^4.0.0","prettier":"^1.5.2","prop-types":"^15.5.10","react":"^15.6.1","react-dom":"^15.6.1","react-router-dom":"^4.1.1","webpack":"^3.0.0","webpack-dev-server":"^2.5.0"},"jest":{"coverageReporters":["json","lcov","text","html"],"resetMocks":true,"roots":["./test"],"testRegex":".*\\.test\\.js$"},"lint-staged":{"{,test/**/}*.js":["eslint","prettier --single-quote --write","git add"]},"dependencies":{"debounce":"^1.0.2","xtend":"^4.0.1"},"gitHead":"1d187db54cefec24e5618fd8a595392a6de742cf","_id":"@mapbox/scroll-restorer@1.0.0","_npmVersion":"5.4.1","_nodeVersion":"6.11.1","_npmUser":{"name":"davidtheclark","email":"david.dave.clark@gmail.com"},"dist":{"integrity":"sha512-9I1LM4It7968f8dulRoK2VwbWfxY4SL26BWTvQFKFTgPK1Xi+/GhLMe32u4Nm04mR2dhLDQjmAUYQ/p79bESyg==","shasum":"a4eb70a4266612d8e638ff8857c295d57c1c8ead","tarball":"https://registry.npmjs.org/@mapbox/scroll-restorer/-/scroll-restorer-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChhu9vSmB1rctUTKWCyMOph7aGkQxx1hzlyZdMoeBYmAIgVdmfhrZJct0b12XCU5vDuXA1R3YK12NUcwLgUuzL+Xo="}]},"maintainers":[{"email":"joe.clark@mapbox.com","name":"jc-clark"},{"email":"xianny@gmail.com","name":"xianny"},{"email":"katherine.meng@mapbox.com","name":"katmeng"},{"email":"dave@mapbox.com","name":"dhcole"},{"email":"dave.prukop@mapbox.com","name":"d-prukop"},{"email":"lizzie.gooding@mapbox.com","name":"lizziegooding"},{"email":"mark.misener@mapbox.com","name":"markmisener"},{"email":"nick.italiano@mapbox.com","name":"nickitaliano"},{"email":"tara.adiseshan@gmail.com","name":"taziam"},{"email":"eli.fitch.prof+npm@gmail.com","name":"elifitch"},{"email":"nadia.barbosa@mapbox.com","name":"captainbarbosa-mbx"},{"email":"cameron@mapbox.com","name":"cammace"},{"email":"bruno@mapbox.com","name":"brunoabinader"},{"email":"langston.smith@mapbox.com","name":"langstonsmith"},{"email":"rafa@mapbox.com","name":"geografa"},{"email":"mxn@1ec5.org","name":"1ec5"},{"email":"liz.shigetoshi@mapbox.com","name":"lshig"},{"email":"hello@johnfurrow.com","name":"johnfurrow"},{"email":"andrea.delrio@mapbox.com","name":"aaaandrea"},{"email":"ali@mapbox.com","name":"alianthes"},{"email":"ann.millspaugh@gmail.com","name":"millzpaugh"},{"email":"hello@franka.tech","name":"franka"},{"email":"charlie@mapbox.com","name":"charloyd"},{"email":"julianne@mapbox.com","name":"juliannebg"},{"email":"dthompson@gmail.com","name":"dthompson"},{"email":"eric.alessandrini@mapbox.com","name":"ericdeveloper"},{"email":"jayana.charles@mapbox.com","name":"jayana"},{"email":"christopher.cailleaux@gmail.com","name":"chriscx"},{"email":"poornima@mapbox.com","name":"poornibadrinath"},{"email":"bersabel.tadesse@mapbox.com","name":"brsbl"},{"email":"mallorywood413@gmail.com","name":"mal-wood"},{"email":"luis@mapbox.com","name":"luiswalter"},{"email":"pilar@mapbox.com","name":"piligab"},{"email":"galia@mapbox.com","name":"yurasi"},{"email":"matt.gosline@mapbox.com","name":"matt.gosline"},{"email":"kelly.young@mapbox.com","name":"kellyoung"},{"email":"mully@mapbox.com","name":"zmully"},{"email":"mikel@groundtruth.in","name":"mikelmaron"},{"email":"danpat@danpat.net","name":"danpat"},{"email":"macro.shen@mapbox.com","name":"macro-shen"},{"email":"asheemm@gmail.com","name":"asheemmamoowala"},{"email":"john.sylak-glassman@mapbox.com","name":"jcsg"},{"email":"michael@mapbox.com","name":"michaelsteffen"},{"email":"aj@mapbox.com","name":"ajashton"},{"email":"devin.boyer@mapbox.com","name":"drboyer"},{"email":"andrey@mapbox.com","name":"andygol"},{"email":"flippmoke@gmail.com","name":"flippmoke"},{"email":"safonov.ilya@gmail.com","name":"ilyasaf"},{"email":"denis.koronchik@gmail.com","name":"deniskoronchik"},{"email":"peterqliu@gmail.com","name":"peterqliu"},{"email":"rasagy@mapbox.com","name":"rasagy"},{"email":"chethan@mapbox.com","name":"chetangowda"},{"email":"upendra@mapbox.com","name":"upendrayadav"},{"email":"cesar@mapbox.com","name":"calfarome"},{"email":"pavel@mapbox.com","name":"ridixcr"},{"email":"olivia.brundage@mapbox.com","name":"oliikit"},{"email":"aileen.s.rowan@gmail.com","name":"allierowan"},{"email":"richman@mapbox.com","name":"richrico"},{"email":"danny@mapbox.com","name":"dannykath"},{"email":"eliane@mapbox.com","name":"samely"},{"email":"nikinfour@gmail.com","name":"nikhilprabhakar"},{"email":"gokul.ganesan@mapbox.com","name":"fa7c0n"},{"email":"blannon@gmail.com","name":"boblannon"},{"email":"sean@mapbox.com","name":"sgillies"},{"email":"me@lukasmartinelli.ch","name":"lukasmartinelli"},{"email":"krishna@mapbox.com","name":"nammala"},{"email":"lindsay@mapbox.com","name":"lndsay"},{"email":"vestibule@anandthakker.net","name":"anandthakker"},{"email":"chris.loer@mapbox.com","name":"chrisloer"},{"email":"0o3ko0@gmail.com","name":"kepta"},{"email":"sam.kronick@mapbox.com","name":"kronick"},{"email":"manohar@mapbox.com","name":"manoharuss"},{"email":"alex.parlato@mapbox.com","name":"aparlato"},{"email":"bharata+npm@mapbox.com","name":"bsrinivasa"},{"email":"aarthy@mapbox.com","name":"aarthykc"},{"email":"dane@mapbox.com","name":"springmeyer"},{"email":"dana.sulit@mapbox.com","name":"dasulit"},{"email":"emmanuel.sambale@gmail.com","name":"maning"},{"email":"miles.sackler@mapbox.com","name":"miles-dev"},{"email":"agafonkin@gmail.com","name":"mourner"},{"email":"hello@chau-nguyen.de","name":"chaupow"},{"email":"michael.krasnyk@gmail.com","name":"oxidase"},{"email":"r.ragupathy85@gmail.com","name":"rumc"},{"email":"vincent.sarago@mapbox.com","name":"vincents"},{"email":"tony.chen@mapbox.com","name":"tony-cj"},{"email":"arun.planemad@gmail.com","name":"planemad"},{"email":"patrick@mapbox.com","name":"themarex"},{"email":"laurier@mapbox.com","name":"l-r"},{"email":"alice@mapbox.com","name":"aliceykuo"},{"email":"ansis.brammanis@gmail.com","name":"ansis"},{"email":"oindrila.gupta92@gmail.com","name":"oini"},{"email":"virginia@mapbox.com","name":"virginiayung"},{"email":"karito@mapbox.com","name":"karitotp"},{"email":"srividyabharadwaj26@gmail.com","name":"srividyacb"},{"email":"perry@mapbox.com","name":"perrygeo"},{"email":"colleen.mcginnis@mapbox.com","name":"colleenmcginnis"},{"email":"nat@mapbox.com","name":"natslaughter"},{"email":"nick.cordella@mapbox.com","name":"nickcordella"},{"email":"benjamin@mapbox.com","name":"benjamintd"},{"email":"fischer@mapbox.com","name":"enf"},{"email":"kai@mapbox.com","name":"kaibot3000"},{"email":"paul@mapbox.com","name":"pdgoodman"},{"email":"max@mapbox.com","name":"msirenko"},{"email":"abhishek@mapbox.com","name":"saikia.abhishek"},{"email":"jothirnadh@mapbox.com","name":"jothirnadh"},{"email":"ryan.baumann@mapbox.com","name":"ryan-baumann"},{"email":"dan@mapbox.com","name":"danswick"},{"email":"lily@mapbox.com","name":"lily-chai"},{"email":"amisha@mapbox.com","name":"amishas157"},{"email":"kara.e.mahoney@gmail.com","name":"k-mahoney"},{"email":"bhargav.kowshik@gmail.com","name":"bkowshik"},{"email":"alinapaz@gmail.com","name":"alinapaz"},{"email":"damon@mapbox.com","name":"dnomadb"},{"email":"lyzi@mapbox.com","name":"lyzidiamond"},{"email":"spam@freenerd.de","name":"freenerd"},{"email":"carol@mapbox.com","name":"gretacb"},{"email":"mayaqgao@gmail.com","name":"mayaqgao"},{"email":"camilla@mapbox.com","name":"camillacaros"},{"email":"saman@mapbox.com","name":"samanbb"},{"email":"bryan@mapbox.com","name":"bhousel"},{"email":"daniel+npm@trvx.org","name":"danieljh"},{"email":"decorah@mapbox.com","name":"katydecorah"},{"email":"ajith@mapbox.com","name":"ajithranka"},{"email":"pratik@mapbox.com","name":"pratikyadav"},{"email":"morgan.herlocker@gmail.com","name":"morganherlocker"},{"email":"hi@jacquestardie.org","name":"jacquestardie"},{"email":"mollylloyd@gmail.com","name":"mollymerp"},{"email":"john.firebaugh@gmail.com","name":"jfirebaugh"},{"email":"tim.channell@gmail.com","name":"tcql"},{"email":"ruben@mapbox.com","name":"rub21"},{"email":"mail@kkaefer.com","name":"kkaefer"},{"email":"brendan@mapbox.com","name":"brendanmcfarland"},{"email":"moritz@mapbox.com","name":"mokob"},{"email":"karen@mapbox.com","name":"karenzshea"},{"email":"david.dave.clark@gmail.com","name":"davidtheclark"},{"email":"amyleewalton@gmail.com","name":"amyleew"},{"email":"ian.villeda@gmail.com","name":"ian29"},{"email":"nicki@mapbox.com","name":"nickidlugash"},{"email":"jake@jakepruitt.com","name":"jrpruit1"},{"email":"mcwhittemore@gmail.com","name":"mcwhittemore"},{"email":"siyu.song@gmail.com","name":"isiyu"},{"email":"ghoshkaj@gmail.com","name":"ghoshkaj"},{"email":"ulsh@mapbox.com","name":"alulsh"},{"email":"emily@mapbox.com","name":"emilymcafee"},{"email":"sam@mapbox.com","name":"mapsam"},{"email":"alex@mapbox.com","name":"lxbarth"},{"email":"will@mapbox.com","name":"willwhite"},{"email":"sanjay@mapbox.com","name":"batpad"},{"email":"sajjadkm@gmail.com","name":"geohacker"},{"email":"aruna@mapbox.com","name":"arunasank"},{"email":"kai@mapbox.com","name":"kaidalgleish"},{"email":"matt@mattficke.com","name":"mattficke"},{"email":"andrew@mapbox.com","name":"apendleton"},{"email":"nicholas.ingalls@gmail.com","name":"ingalls"},{"email":"thomas.j.lee@gmail.com","name":"sbma44"},{"email":"dubois@mapbox.com","name":"emilymdubois"},{"email":"young@mapbox.com","name":"yhahn"},{"email":"ian@mapbox.com","name":"ianshward"},{"email":"jeff@miccolis.net","name":"miccolis"},{"email":"ryan.clark.j@gmail.com","name":"rclark"},{"email":"lauren@mapbox.com","name":"lbud"},{"email":"bobby@mapbox.com","name":"bsudekum"},{"email":"tristen.brown@gmail.com","name":"tristen"},{"email":"accounts@mapbox.com","name":"mapbox-admin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scroll-restorer-1.0.0.tgz_1504910083939_0.5922454765532166"},"directories":{}},"1.1.0":{"name":"@mapbox/scroll-restorer","version":"1.1.0","description":"Preserve scroll state while navigating client-side routes","main":"index.js","scripts":{"precommit":"lint-staged","format":"prettier --single-quote --write '{,test/**/}*.js'","lint":"eslint .","start-example-app":"webpack-dev-server --config ./example/webpack.config.js","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/mapbox/scroll-restorer.git"},"keywords":["scroll-restoration","scroll","restore","routing","router"],"author":{"name":"Mapbox"},"license":"MIT","bugs":{"url":"https://github.com/mapbox/scroll-restorer/issues"},"homepage":"https://github.com/mapbox/scroll-restorer#readme","devDependencies":{"@babel/core":"^7","@babel/eslint-parser":"^7","babel-loader":"^9","@babel/preset-env":"^7","@babel/preset-react":"^7","@babel/plugin-proposal-function-bind":"^7","eslint":"^8","eslint-plugin-react":"^7.1.0","husky":"^8","jest":"^29","jest-environment-jsdom":"^29.7.0","lint-staged":"^15","prettier":"^3","prop-types":"^15","react":"^16","react-dom":"^16","react-router-dom":"^4.1.1","webpack":"^5","webpack-cli":"^5.1.4","webpack-dev-server":"^4"},"jest":{"coverageReporters":["json","lcov","text","html"],"resetMocks":true,"roots":["./test"],"testRegex":".*\\.test\\.js$"},"lint-staged":{"{,test/**/}*.js":["eslint","prettier --single-quote --write","git add"]},"dependencies":{"debounce":"^1.0.2","xtend":"^4.0.1"},"_id":"@mapbox/scroll-restorer@1.1.0","gitHead":"727fc99b38c82e9f9f464ce5054f26b9df4f7271","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-FnjQYgWcKBqalY4P1+6V8iEhQQqPfOJm1V/7o1ZeeoXgHmkNkKUpHuzPCV1hUPge64rVccxt2kS2WNq7jz2gOQ==","shasum":"e9f0b974dc43b725dd3a08fc858e11a27459cd56","tarball":"https://registry.npmjs.org/@mapbox/scroll-restorer/-/scroll-restorer-1.1.0.tgz","fileCount":16,"unpackedSize":51937,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMQ2pSfmyNOa+ZIJ4WXSL6dGIikHSw2V3JuWnCmev+7gIhAIK2bT+mCYe6F6rS9iqjMeoeOvC+Ub1Jvp5PtV4QoxqH"}]},"_npmUser":{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},"directories":{},"maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scroll-restorer_1.1.0_1698773891794_0.14368907606767145"},"_hasShrinkwrap":false}},"readme":"# @mapbox/scroll-restorer\n\nPreserve the scroll state of [`document.scrollingElement`](https://developer.mozilla.org/en-US/docs/Web/API/Document/scrollingElement) while navigating programmatically through history states — that is, client-side routing.\n\n## Installation\n\n```\nnpm install @mapbox/scroll-restorer\n```\n\n## Usage\n\n1. Invoke the [`start`] method when you would like to begin storing the browser's scroll position in history states, likely when your application mounts.\n2. Invoke the [`stop`] method when you would like to stop the restoration of scroll position, likely when your application unmounts.\n\nHave a look at [an example using React Router](./example).\n\n## API\n\n### start\n\n`scrollRestorer.start([options])`\n\nStarts tracking the user's scroll position.\n\n#### options\n\n##### autoRestore\n\nType: `boolean`.\nDefault: `true`.\n\nWhen `true`, `scroll-restorer` will attempt to restore the scroll position on each `popstate` event. Set this to `false` if you want to *manually* control the scroll position restoration (e.g. you may wish to call [`restoreScroll`] at a very specific point in your application's rendering lifecycle).\n\n##### captureScrollDebounce\n\nType: `number`.\nDefault: `50`.\n\nThe number of milliseconds by which the scroll-capturing function should be debounced.\n\n### end\n\n`scrollRestorer.end()`\n\nEnd scroll-restorer's behavior.\n\n### getSavedScroll\n\n`scrollRestorer.getSavedScroll([input])`\n\nReturns the scroll position retrieved from `window.history` or an optional `popstate` event.\nWhen the [`autoRestore`] option of [`start`] is `true`, this method will be invoked automatically, so you only want to use it manually if you've set [`autoRestore`] to `false`.\n\n#### input\n\nType: `{ state: Object }`, either `window.history` or a `popstate` event.\nDefault: `window.history`.\n\n### restoreScroll\n\n`scrollRestorer.restoreScroll([input, attempts])`\n\nManually restore the scroll position for a given history state or `popstate` event.\n\nWhen the [`autoRestore`] option of [`start`] is `true`, this method will be invoked automatically, so you only want to use it manually if you've set [`autoRestore`] to `false`.\n\n#### input\n\nType: `{ state: Object }`, either `window.history` or a `popstate` event.\nDefault: `window.history`.\n\n#### attempts\n\nType: `number`.\nDefault: `5`.\n\nThe number of times to attempt adjusting the scroll position.\nscroll-restorer might need to make multiple attempts if the saved scroll state refers to a position that is not yet available because content is still loading.\n\n## React & React Router Example\n\n```jsx\nimport React, {Component} from 'react';\nimport {HashRouter, Link, Route} from 'react-router-dom';\nimport scrollRestorer from '@mapbox/scroll-restorer';\n\nclass ScrollRestorerExample extends Component {\n  componentDidMount() {\n    // Initiate the scroll position restoration behavior.\n    scrollRestorer.start();\n  }\n\n  componentWillUnmount() {\n    // Cease the scroll position restoration behavior.\n    scrollRestorer.stop();\n  }\n\n  getContent(numParagraphs) {\n    const paragraphArr = new Array(numParagraphs).fill();\n\n    return (\n      <div>\n        <h1>Here are {numParagraphs} paragraph elements, enjoy!</h1>\n        {paragraphArr.map((_, index) => <p key={index}>Paragraph #{index}.</p>)}\n      </div>\n    );\n  }\n\n  render() {\n    return (\n      <HashRouter>\n        <div>\n          <nav style={{background: '#fff', position: 'fixed', top: 0, left: 0, width: '100%'}}>\n            <Link to=\"/\">Home</Link> &nbsp;\n            <Link to=\"/page-a\">Page A</Link> &nbsp;\n            <Link to=\"/page-b\">Page B</Link> &nbsp;\n            <Link to=\"/page-c\">Page C</Link>\n          </nav>\n          <main style={{marginTop: '40px'}}>\n            <Route exact path=\"/\" render={() => <h1>This is the home page.</h1>} />\n            <Route exact path=\"/page-a\" render={() => this.getContent(5)} />\n            <Route exact path=\"/page-b\" render={() => this.getContent(20)} />\n            <Route exact path=\"/page-c\" render={() => this.getContent(100)} />\n          </main>\n        </div>\n      </HashRouter>\n    );\n  }\n}\n\nexport default ScrollRestorerExample;\n```\n\n## Influences\n\n- [delayed-scroll-restoration-polyfill](https://github.com/brigade/delayed-scroll-restoration-polyfill)\n- [scroll-behavior](https://github.com/taion/scroll-behavior)\n\n[`start`]: #start\n[`stop`]: #stop\n[`restoreScroll`]: #restorescroll\n[`autoRestore`]: #autorestore\n","maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"time":{"modified":"2023-10-31T17:38:12.554Z","created":"2017-07-06T22:48:27.842Z","0.1.0":"2017-07-06T22:48:27.842Z","1.0.0":"2017-09-08T22:34:44.034Z","1.1.0":"2023-10-31T17:38:12.033Z"},"homepage":"https://github.com/mapbox/scroll-restorer#readme","keywords":["scroll-restoration","scroll","restore","routing","router"],"repository":{"type":"git","url":"git+https://github.com/mapbox/scroll-restorer.git"},"author":{"name":"Mapbox"},"bugs":{"url":"https://github.com/mapbox/scroll-restorer/issues"},"license":"MIT","readmeFilename":"README.md"}