├── .github └── workflows │ └── npm-publish.yml ├── .gitignore ├── LICENSE ├── README.md ├── docs ├── 404 │ └── index.html ├── 404.html ├── _next │ └── static │ │ ├── 4sqlbClfUSlXTJdWiI9ED │ │ ├── _buildManifest.js │ │ ├── _ssgManifest.js │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _error.js │ │ │ └── index.js │ │ ├── 5pcoQMCK8ydsudtiq7kxB │ │ ├── _buildManifest.js │ │ ├── _ssgManifest.js │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _error.js │ │ │ └── index.js │ │ ├── BPOEM54sG5rOVcTk_zZGp │ │ ├── _buildManifest.js │ │ ├── _ssgManifest.js │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _error.js │ │ │ └── index.js │ │ ├── RnUve1OqxCMPWcfLP9XLT │ │ ├── _buildManifest.js │ │ ├── _ssgManifest.js │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _error.js │ │ │ └── index.js │ │ ├── chunks │ │ ├── 0.js │ │ ├── 0.js.map │ │ ├── 145a4e6a0fdcae8fef9d34000cfe890c0a7f4b28.f996138c8a92a6f1bcc0.js │ │ ├── 3bc329d8bc2947a051aa46a791a9990e368b2270.f996138c8a92a6f1bcc0.js │ │ ├── 4d47637119fc466886a74513d3aeb62698b19896.f996138c8a92a6f1bcc0.js │ │ ├── b78ed8a3ddb65d751b105fc8683db78ca1a4e4b5.f996138c8a92a6f1bcc0.js │ │ ├── db47b03e77cda44454f1ae3830609ca0ba90aa34.f996138c8a92a6f1bcc0.js │ │ ├── e5435b7f796beb9236fca827f27041d94b2abded.f996138c8a92a6f1bcc0.js │ │ └── framework.d5efbf0a8a20bb777e8e.js │ │ ├── dYfIn4-TShReIX9hubX9J │ │ ├── _buildManifest.js │ │ ├── _ssgManifest.js │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _error.js │ │ │ └── index.js │ │ ├── development │ │ ├── _buildManifest.js │ │ ├── _ssgManifest.js │ │ ├── dll │ │ │ ├── dll_bc8aa67234757793b72a.js │ │ │ └── dll_bc8aa67234757793b72a.js.map │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _app.js.map │ │ │ ├── _error.js │ │ │ ├── _error.js.map │ │ │ ├── index.js │ │ │ ├── index.js.map │ │ │ └── next │ │ │ └── dist │ │ │ └── pages │ │ │ ├── _error.js │ │ │ └── _error.js.map │ │ ├── kZGawXPz4M7fsaH_w9E8C │ │ ├── _buildManifest.js │ │ ├── _ssgManifest.js │ │ └── pages │ │ │ ├── _app.js │ │ │ ├── _error.js │ │ │ └── index.js │ │ ├── runtime │ │ ├── amp.js │ │ ├── amp.js.map │ │ ├── main-b1b3bf6813b73dc63172.js │ │ ├── main.js │ │ ├── main.js.map │ │ ├── polyfills-0e1950c8b6ff6c7651db.js │ │ ├── polyfills.js │ │ ├── polyfills.js.map │ │ ├── webpack-b65cab0b00afd201cbda.js │ │ ├── webpack.js │ │ └── webpack.js.map │ │ └── webpack │ │ ├── 036f3b1c6593ba93a4c1.hot-update.json │ │ ├── 039d4501ec86fc263656.hot-update.json │ │ ├── 0a38e61d7bc87bc52266.hot-update.json │ │ ├── 0aed3914e726ed4bff13.hot-update.json │ │ ├── 0b9f160585330f395942.hot-update.json │ │ ├── 0dd70db4db3b7a7cb7d0.hot-update.json │ │ ├── 0efaf424d85e12544930.hot-update.json │ │ ├── 15e2f3d7958b59d308d4.hot-update.json │ │ ├── 16d1ed4342f8f874aab1.hot-update.json │ │ ├── 17d7b66f7ed9253fd2ae.hot-update.json │ │ ├── 18057c0389a55e7173f6.hot-update.json │ │ ├── 1c2797b5a0251264c327.hot-update.json │ │ ├── 1d7551dc0c14608e3fd6.hot-update.json │ │ ├── 219b1c0597e915c720f1.hot-update.json │ │ ├── 2204b15764d6799a74a0.hot-update.json │ │ ├── 2346505eb05594ed0f24.hot-update.json │ │ ├── 236a57432a85cd30725a.hot-update.json │ │ ├── 24f82f925df52b4e75e9.hot-update.json │ │ ├── 26bcdde27e3b2514fde2.hot-update.json │ │ ├── 2a0edb30b7410e3404dd.hot-update.json │ │ ├── 2bb6320281757b788866.hot-update.json │ │ ├── 31aa308ffa13b5c83ad0.hot-update.json │ │ ├── 342dbd7e8816b2df294b.hot-update.json │ │ ├── 36633110adef5926c9eb.hot-update.json │ │ ├── 37967707fdf41b3b6e7c.hot-update.json │ │ ├── 37e30aeb6a4234d123b6.hot-update.json │ │ ├── 393cb905b34417b7c0ad.hot-update.json │ │ ├── 3ad6fd737417f6cd4912.hot-update.json │ │ ├── 3ba519695ef08ae10b5b.hot-update.json │ │ ├── 3d2cb92148f2f10a6f4e.hot-update.json │ │ ├── 40b98d9fe4a3e60a51c5.hot-update.json │ │ ├── 4c27178b18bb1b8cbf23.hot-update.json │ │ ├── 4d27eccb94350f45c726.hot-update.json │ │ ├── 4e68e35c7c9b80da491d.hot-update.json │ │ ├── 4f4c75e52f089b3f6df7.hot-update.json │ │ ├── 526c9bc6846500d7de4a.hot-update.json │ │ ├── 54a6ea4f698a159e17e1.hot-update.json │ │ ├── 54f3a91b5d0c53d4c6af.hot-update.json │ │ ├── 551a09f77bb3d2039ae7.hot-update.json │ │ ├── 5b07894a52d4713453b9.hot-update.json │ │ ├── 5f45af34cd613b52de43.hot-update.json │ │ ├── 6485b480921d02bc37d8.hot-update.json │ │ ├── 67c595c4b97d4bddb530.hot-update.json │ │ ├── 6858aee858455f004286.hot-update.json │ │ ├── 6858dab54b9a3b836abb.hot-update.json │ │ ├── 6afd52a4a0dced85fcf4.hot-update.json │ │ ├── 6c3e291c50829de51b41.hot-update.json │ │ ├── 6c74e4e8f670d0eccf57.hot-update.json │ │ ├── 6c910ea97d8d3256b618.hot-update.json │ │ ├── 6da7518d4fbee16a7dd4.hot-update.json │ │ ├── 70153fef0f34ba881678.hot-update.json │ │ ├── 7040a7f0f467a30cb495.hot-update.json │ │ ├── 715d6aba915415315a0e.hot-update.json │ │ ├── 7a600c615c13c95b99b1.hot-update.json │ │ ├── 7c795050be505fa31a29.hot-update.json │ │ ├── 801a363b1858906fabd7.hot-update.json │ │ ├── 80b3514032782fa6a0c3.hot-update.json │ │ ├── 80b6449be7d0972a274f.hot-update.json │ │ ├── 83ec36960c4107f59922.hot-update.json │ │ ├── 87babbd4b1bba557c480.hot-update.json │ │ ├── 8d71c9d3ac942a8f2cb8.hot-update.json │ │ ├── 8df7d4a4b11f90c63ae2.hot-update.json │ │ ├── 8e6b656079fee61b5ba0.hot-update.json │ │ ├── 9020cae4abf5f01be613.hot-update.json │ │ ├── 915c08ded6c26f22caac.hot-update.json │ │ ├── 9191a62b9dc2514718d1.hot-update.json │ │ ├── 91bfc83fd2525db8961e.hot-update.json │ │ ├── 941af8f1f710caf1afa6.hot-update.json │ │ ├── 976d703e5ae2f2375380.hot-update.json │ │ ├── 9808bfee36bcfd4f5a16.hot-update.json │ │ ├── 985854139c5137267d43.hot-update.json │ │ ├── 98dc7d550708bdf1043b.hot-update.json │ │ ├── 9afad189f4a73a44d14d.hot-update.json │ │ ├── 9bb73e04fa30a8d40e25.hot-update.json │ │ ├── 9db8138ee9504cb10180.hot-update.json │ │ ├── 9e472434a10c3e1373d4.hot-update.json │ │ ├── a22968ccc32bc52a3c96.hot-update.json │ │ ├── a3b35cb9fb64a28771dd.hot-update.json │ │ ├── a40d3d0b2c42cc5bc670.hot-update.json │ │ ├── a4a21b2602ac7d3e76d0.hot-update.json │ │ ├── a6be95e6c8786019f248.hot-update.json │ │ ├── ad19a97aa5ffef658bc6.hot-update.json │ │ ├── b418504726c1fa710527.hot-update.json │ │ ├── b45eb7170ee96231e1ad.hot-update.json │ │ ├── b55565574c54273f020c.hot-update.json │ │ ├── b69697f32a514207a4b0.hot-update.json │ │ ├── b9af64d2fe4223d0afd0.hot-update.json │ │ ├── ba0935dd6efe5a45bd70.hot-update.json │ │ ├── bca1baf438a6eb242d51.hot-update.json │ │ ├── becce96f27463c558977.hot-update.json │ │ ├── beebc6bb4de2c5ed6cf2.hot-update.json │ │ ├── c2dca4518b6e10a589ea.hot-update.json │ │ ├── c370a4757a7ac3773039.hot-update.json │ │ ├── c3f29612f19905e02269.hot-update.json │ │ ├── c4a0c76495eff3fc261c.hot-update.json │ │ ├── c4e90340ada471f95855.hot-update.json │ │ ├── c503a3bbb0b4d64df54a.hot-update.json │ │ ├── c5cec29b880d9a137df1.hot-update.json │ │ ├── c91d389155b6d1b2edc9.hot-update.json │ │ ├── c98928c20e702d791e0e.hot-update.json │ │ ├── caa3f9dc9c57ac7387ec.hot-update.json │ │ ├── cbc190672350e0612784.hot-update.json │ │ ├── cc39d7d5dd5d2d66d175.hot-update.json │ │ ├── cdaead03c4bd32ae77b4.hot-update.json │ │ ├── ced5c06424264964348e.hot-update.json │ │ ├── cfe6921ae675ffec2ed8.hot-update.json │ │ ├── d6d4a5dedcb8e8b27829.hot-update.json │ │ ├── d74f018aa572c3089d42.hot-update.json │ │ ├── d7d88e889bc39cf2da4f.hot-update.json │ │ ├── d9e0c598d8cb970224bb.hot-update.json │ │ ├── dc08f2cc3dc215979819.hot-update.json │ │ ├── de5b6b03b96ff7772dfc.hot-update.json │ │ ├── e0074df4a59d9c2b8f9f.hot-update.json │ │ ├── e20087eec4eeacadeedc.hot-update.json │ │ ├── e4354c2b7c7cf737c810.hot-update.json │ │ ├── e74c7e0f7f6683cf78e9.hot-update.json │ │ ├── e88f45d777b20ea616ad.hot-update.json │ │ ├── eb75460038bcdc79fc4d.hot-update.json │ │ ├── ee24467d4d6fe60aceae.hot-update.json │ │ ├── efd089876b08c80349d0.hot-update.json │ │ ├── f0b267c9387f14cd18b8.hot-update.json │ │ ├── f1f70d1e8b0a90fb6608.hot-update.json │ │ ├── f76db252ae5d756f576e.hot-update.json │ │ ├── f9a59798a8907b2e7b0d.hot-update.json │ │ ├── fb7333a24414e8cb98d1.hot-update.json │ │ ├── fb86b8c0adc87afde0e6.hot-update.json │ │ ├── fbc951b0463b535dd01d.hot-update.json │ │ ├── fc6df17198cf75a09ea6.hot-update.json │ │ ├── fc849e50a4e73ac727b4.hot-update.json │ │ ├── ff25b82d875169052f53.hot-update.json │ │ └── static │ │ └── development │ │ └── pages │ │ ├── index.js.036f3b1c6593ba93a4c1.hot-update.js │ │ ├── index.js.036f3b1c6593ba93a4c1.hot-update.js.map │ │ ├── index.js.039d4501ec86fc263656.hot-update.js │ │ ├── index.js.039d4501ec86fc263656.hot-update.js.map │ │ ├── index.js.0a38e61d7bc87bc52266.hot-update.js │ │ ├── index.js.0a38e61d7bc87bc52266.hot-update.js.map │ │ ├── index.js.0aed3914e726ed4bff13.hot-update.js │ │ ├── index.js.0aed3914e726ed4bff13.hot-update.js.map │ │ ├── index.js.0b9f160585330f395942.hot-update.js │ │ ├── index.js.0b9f160585330f395942.hot-update.js.map │ │ ├── index.js.0dd70db4db3b7a7cb7d0.hot-update.js │ │ ├── index.js.0dd70db4db3b7a7cb7d0.hot-update.js.map │ │ ├── index.js.0efaf424d85e12544930.hot-update.js │ │ ├── index.js.0efaf424d85e12544930.hot-update.js.map │ │ ├── index.js.15e2f3d7958b59d308d4.hot-update.js │ │ ├── index.js.15e2f3d7958b59d308d4.hot-update.js.map │ │ ├── index.js.16d1ed4342f8f874aab1.hot-update.js │ │ ├── index.js.16d1ed4342f8f874aab1.hot-update.js.map │ │ ├── index.js.17d7b66f7ed9253fd2ae.hot-update.js │ │ ├── index.js.17d7b66f7ed9253fd2ae.hot-update.js.map │ │ ├── index.js.18057c0389a55e7173f6.hot-update.js │ │ ├── index.js.18057c0389a55e7173f6.hot-update.js.map │ │ ├── index.js.1c2797b5a0251264c327.hot-update.js │ │ ├── index.js.1c2797b5a0251264c327.hot-update.js.map │ │ ├── index.js.1d7551dc0c14608e3fd6.hot-update.js │ │ ├── index.js.1d7551dc0c14608e3fd6.hot-update.js.map │ │ ├── index.js.219b1c0597e915c720f1.hot-update.js │ │ ├── index.js.219b1c0597e915c720f1.hot-update.js.map │ │ ├── index.js.2204b15764d6799a74a0.hot-update.js │ │ ├── index.js.2204b15764d6799a74a0.hot-update.js.map │ │ ├── index.js.236a57432a85cd30725a.hot-update.js │ │ ├── index.js.236a57432a85cd30725a.hot-update.js.map │ │ ├── index.js.24f82f925df52b4e75e9.hot-update.js │ │ ├── index.js.24f82f925df52b4e75e9.hot-update.js.map │ │ ├── index.js.26bcdde27e3b2514fde2.hot-update.js │ │ ├── index.js.26bcdde27e3b2514fde2.hot-update.js.map │ │ ├── index.js.2a0edb30b7410e3404dd.hot-update.js │ │ ├── index.js.2a0edb30b7410e3404dd.hot-update.js.map │ │ ├── index.js.2bb6320281757b788866.hot-update.js │ │ ├── index.js.2bb6320281757b788866.hot-update.js.map │ │ ├── index.js.31aa308ffa13b5c83ad0.hot-update.js │ │ ├── index.js.31aa308ffa13b5c83ad0.hot-update.js.map │ │ ├── index.js.342dbd7e8816b2df294b.hot-update.js │ │ ├── index.js.342dbd7e8816b2df294b.hot-update.js.map │ │ ├── index.js.36633110adef5926c9eb.hot-update.js │ │ ├── index.js.36633110adef5926c9eb.hot-update.js.map │ │ ├── index.js.37967707fdf41b3b6e7c.hot-update.js │ │ ├── index.js.37967707fdf41b3b6e7c.hot-update.js.map │ │ ├── index.js.37e30aeb6a4234d123b6.hot-update.js │ │ ├── index.js.37e30aeb6a4234d123b6.hot-update.js.map │ │ ├── index.js.3ad6fd737417f6cd4912.hot-update.js │ │ ├── index.js.3ad6fd737417f6cd4912.hot-update.js.map │ │ ├── index.js.3ba519695ef08ae10b5b.hot-update.js │ │ ├── index.js.3ba519695ef08ae10b5b.hot-update.js.map │ │ ├── index.js.3d2cb92148f2f10a6f4e.hot-update.js │ │ ├── index.js.3d2cb92148f2f10a6f4e.hot-update.js.map │ │ ├── index.js.40b98d9fe4a3e60a51c5.hot-update.js │ │ ├── index.js.40b98d9fe4a3e60a51c5.hot-update.js.map │ │ ├── index.js.4c27178b18bb1b8cbf23.hot-update.js │ │ ├── index.js.4c27178b18bb1b8cbf23.hot-update.js.map │ │ ├── index.js.4d27eccb94350f45c726.hot-update.js │ │ ├── index.js.4d27eccb94350f45c726.hot-update.js.map │ │ ├── index.js.4e68e35c7c9b80da491d.hot-update.js │ │ ├── index.js.4e68e35c7c9b80da491d.hot-update.js.map │ │ ├── index.js.4f4c75e52f089b3f6df7.hot-update.js │ │ ├── index.js.4f4c75e52f089b3f6df7.hot-update.js.map │ │ ├── index.js.526c9bc6846500d7de4a.hot-update.js │ │ ├── index.js.526c9bc6846500d7de4a.hot-update.js.map │ │ ├── index.js.5b07894a52d4713453b9.hot-update.js │ │ ├── index.js.5b07894a52d4713453b9.hot-update.js.map │ │ ├── index.js.5f45af34cd613b52de43.hot-update.js │ │ ├── index.js.5f45af34cd613b52de43.hot-update.js.map │ │ ├── index.js.6485b480921d02bc37d8.hot-update.js │ │ ├── index.js.6485b480921d02bc37d8.hot-update.js.map │ │ ├── index.js.67c595c4b97d4bddb530.hot-update.js │ │ ├── index.js.67c595c4b97d4bddb530.hot-update.js.map │ │ ├── index.js.6858dab54b9a3b836abb.hot-update.js │ │ ├── index.js.6858dab54b9a3b836abb.hot-update.js.map │ │ ├── index.js.6afd52a4a0dced85fcf4.hot-update.js │ │ ├── index.js.6afd52a4a0dced85fcf4.hot-update.js.map │ │ ├── index.js.6c3e291c50829de51b41.hot-update.js │ │ ├── index.js.6c3e291c50829de51b41.hot-update.js.map │ │ ├── index.js.6c910ea97d8d3256b618.hot-update.js │ │ ├── index.js.6c910ea97d8d3256b618.hot-update.js.map │ │ ├── index.js.6da7518d4fbee16a7dd4.hot-update.js │ │ ├── index.js.6da7518d4fbee16a7dd4.hot-update.js.map │ │ ├── index.js.70153fef0f34ba881678.hot-update.js │ │ ├── index.js.70153fef0f34ba881678.hot-update.js.map │ │ ├── index.js.7040a7f0f467a30cb495.hot-update.js │ │ ├── index.js.7040a7f0f467a30cb495.hot-update.js.map │ │ ├── index.js.715d6aba915415315a0e.hot-update.js │ │ ├── index.js.715d6aba915415315a0e.hot-update.js.map │ │ ├── index.js.7a600c615c13c95b99b1.hot-update.js │ │ ├── index.js.7a600c615c13c95b99b1.hot-update.js.map │ │ ├── index.js.7c795050be505fa31a29.hot-update.js │ │ ├── index.js.7c795050be505fa31a29.hot-update.js.map │ │ ├── index.js.801a363b1858906fabd7.hot-update.js │ │ ├── index.js.801a363b1858906fabd7.hot-update.js.map │ │ ├── index.js.80b3514032782fa6a0c3.hot-update.js │ │ ├── index.js.80b3514032782fa6a0c3.hot-update.js.map │ │ ├── index.js.80b6449be7d0972a274f.hot-update.js │ │ ├── index.js.80b6449be7d0972a274f.hot-update.js.map │ │ ├── index.js.83ec36960c4107f59922.hot-update.js │ │ ├── index.js.83ec36960c4107f59922.hot-update.js.map │ │ ├── index.js.8d71c9d3ac942a8f2cb8.hot-update.js │ │ ├── index.js.8d71c9d3ac942a8f2cb8.hot-update.js.map │ │ ├── index.js.8df7d4a4b11f90c63ae2.hot-update.js │ │ ├── index.js.8df7d4a4b11f90c63ae2.hot-update.js.map │ │ ├── index.js.8e6b656079fee61b5ba0.hot-update.js │ │ ├── index.js.8e6b656079fee61b5ba0.hot-update.js.map │ │ ├── index.js.9020cae4abf5f01be613.hot-update.js │ │ ├── index.js.9020cae4abf5f01be613.hot-update.js.map │ │ ├── index.js.915c08ded6c26f22caac.hot-update.js │ │ ├── index.js.915c08ded6c26f22caac.hot-update.js.map │ │ ├── index.js.91bfc83fd2525db8961e.hot-update.js │ │ ├── index.js.91bfc83fd2525db8961e.hot-update.js.map │ │ ├── index.js.941af8f1f710caf1afa6.hot-update.js │ │ ├── index.js.941af8f1f710caf1afa6.hot-update.js.map │ │ ├── index.js.976d703e5ae2f2375380.hot-update.js │ │ ├── index.js.976d703e5ae2f2375380.hot-update.js.map │ │ ├── index.js.9808bfee36bcfd4f5a16.hot-update.js │ │ ├── index.js.9808bfee36bcfd4f5a16.hot-update.js.map │ │ ├── index.js.985854139c5137267d43.hot-update.js │ │ ├── index.js.985854139c5137267d43.hot-update.js.map │ │ ├── index.js.98dc7d550708bdf1043b.hot-update.js │ │ ├── index.js.98dc7d550708bdf1043b.hot-update.js.map │ │ ├── index.js.9afad189f4a73a44d14d.hot-update.js │ │ ├── index.js.9afad189f4a73a44d14d.hot-update.js.map │ │ ├── index.js.9bb73e04fa30a8d40e25.hot-update.js │ │ ├── index.js.9bb73e04fa30a8d40e25.hot-update.js.map │ │ ├── index.js.9db8138ee9504cb10180.hot-update.js │ │ ├── index.js.9db8138ee9504cb10180.hot-update.js.map │ │ ├── index.js.9e472434a10c3e1373d4.hot-update.js │ │ ├── index.js.9e472434a10c3e1373d4.hot-update.js.map │ │ ├── index.js.a22968ccc32bc52a3c96.hot-update.js │ │ ├── index.js.a22968ccc32bc52a3c96.hot-update.js.map │ │ ├── index.js.a3b35cb9fb64a28771dd.hot-update.js │ │ ├── index.js.a3b35cb9fb64a28771dd.hot-update.js.map │ │ ├── index.js.a40d3d0b2c42cc5bc670.hot-update.js │ │ ├── index.js.a40d3d0b2c42cc5bc670.hot-update.js.map │ │ ├── index.js.a4a21b2602ac7d3e76d0.hot-update.js │ │ ├── index.js.a4a21b2602ac7d3e76d0.hot-update.js.map │ │ ├── index.js.a6be95e6c8786019f248.hot-update.js │ │ ├── index.js.a6be95e6c8786019f248.hot-update.js.map │ │ ├── index.js.b418504726c1fa710527.hot-update.js │ │ ├── index.js.b418504726c1fa710527.hot-update.js.map │ │ ├── index.js.b45eb7170ee96231e1ad.hot-update.js │ │ ├── index.js.b45eb7170ee96231e1ad.hot-update.js.map │ │ ├── index.js.b55565574c54273f020c.hot-update.js │ │ ├── index.js.b55565574c54273f020c.hot-update.js.map │ │ ├── index.js.b69697f32a514207a4b0.hot-update.js │ │ ├── index.js.b69697f32a514207a4b0.hot-update.js.map │ │ ├── index.js.b9af64d2fe4223d0afd0.hot-update.js │ │ ├── index.js.b9af64d2fe4223d0afd0.hot-update.js.map │ │ ├── index.js.ba0935dd6efe5a45bd70.hot-update.js │ │ ├── index.js.ba0935dd6efe5a45bd70.hot-update.js.map │ │ ├── index.js.bca1baf438a6eb242d51.hot-update.js │ │ ├── index.js.bca1baf438a6eb242d51.hot-update.js.map │ │ ├── index.js.becce96f27463c558977.hot-update.js │ │ ├── index.js.becce96f27463c558977.hot-update.js.map │ │ ├── index.js.beebc6bb4de2c5ed6cf2.hot-update.js │ │ ├── index.js.beebc6bb4de2c5ed6cf2.hot-update.js.map │ │ ├── index.js.c2dca4518b6e10a589ea.hot-update.js │ │ ├── index.js.c2dca4518b6e10a589ea.hot-update.js.map │ │ ├── index.js.c370a4757a7ac3773039.hot-update.js │ │ ├── index.js.c370a4757a7ac3773039.hot-update.js.map │ │ ├── index.js.c3f29612f19905e02269.hot-update.js │ │ ├── index.js.c3f29612f19905e02269.hot-update.js.map │ │ ├── index.js.c4a0c76495eff3fc261c.hot-update.js │ │ ├── index.js.c4a0c76495eff3fc261c.hot-update.js.map │ │ ├── index.js.c4e90340ada471f95855.hot-update.js │ │ ├── index.js.c4e90340ada471f95855.hot-update.js.map │ │ ├── index.js.c503a3bbb0b4d64df54a.hot-update.js │ │ ├── index.js.c503a3bbb0b4d64df54a.hot-update.js.map │ │ ├── index.js.c5cec29b880d9a137df1.hot-update.js │ │ ├── index.js.c5cec29b880d9a137df1.hot-update.js.map │ │ ├── index.js.c91d389155b6d1b2edc9.hot-update.js │ │ ├── index.js.c91d389155b6d1b2edc9.hot-update.js.map │ │ ├── index.js.c98928c20e702d791e0e.hot-update.js │ │ ├── index.js.c98928c20e702d791e0e.hot-update.js.map │ │ ├── index.js.caa3f9dc9c57ac7387ec.hot-update.js │ │ ├── index.js.caa3f9dc9c57ac7387ec.hot-update.js.map │ │ ├── index.js.cbc190672350e0612784.hot-update.js │ │ ├── index.js.cbc190672350e0612784.hot-update.js.map │ │ ├── index.js.cc39d7d5dd5d2d66d175.hot-update.js │ │ ├── index.js.cc39d7d5dd5d2d66d175.hot-update.js.map │ │ ├── index.js.cdaead03c4bd32ae77b4.hot-update.js │ │ ├── index.js.cdaead03c4bd32ae77b4.hot-update.js.map │ │ ├── index.js.ced5c06424264964348e.hot-update.js │ │ ├── index.js.ced5c06424264964348e.hot-update.js.map │ │ ├── index.js.cfe6921ae675ffec2ed8.hot-update.js │ │ ├── index.js.cfe6921ae675ffec2ed8.hot-update.js.map │ │ ├── index.js.d6d4a5dedcb8e8b27829.hot-update.js │ │ ├── index.js.d6d4a5dedcb8e8b27829.hot-update.js.map │ │ ├── index.js.d74f018aa572c3089d42.hot-update.js │ │ ├── index.js.d74f018aa572c3089d42.hot-update.js.map │ │ ├── index.js.d7d88e889bc39cf2da4f.hot-update.js │ │ ├── index.js.d7d88e889bc39cf2da4f.hot-update.js.map │ │ ├── index.js.d9e0c598d8cb970224bb.hot-update.js │ │ ├── index.js.d9e0c598d8cb970224bb.hot-update.js.map │ │ ├── index.js.dc08f2cc3dc215979819.hot-update.js │ │ ├── index.js.dc08f2cc3dc215979819.hot-update.js.map │ │ ├── index.js.de5b6b03b96ff7772dfc.hot-update.js │ │ ├── index.js.de5b6b03b96ff7772dfc.hot-update.js.map │ │ ├── index.js.e0074df4a59d9c2b8f9f.hot-update.js │ │ ├── index.js.e0074df4a59d9c2b8f9f.hot-update.js.map │ │ ├── index.js.e20087eec4eeacadeedc.hot-update.js │ │ ├── index.js.e20087eec4eeacadeedc.hot-update.js.map │ │ ├── index.js.e4354c2b7c7cf737c810.hot-update.js │ │ ├── index.js.e4354c2b7c7cf737c810.hot-update.js.map │ │ ├── index.js.e74c7e0f7f6683cf78e9.hot-update.js │ │ ├── index.js.e74c7e0f7f6683cf78e9.hot-update.js.map │ │ ├── index.js.e88f45d777b20ea616ad.hot-update.js │ │ ├── index.js.e88f45d777b20ea616ad.hot-update.js.map │ │ ├── index.js.eb75460038bcdc79fc4d.hot-update.js │ │ ├── index.js.eb75460038bcdc79fc4d.hot-update.js.map │ │ ├── index.js.ee24467d4d6fe60aceae.hot-update.js │ │ ├── index.js.ee24467d4d6fe60aceae.hot-update.js.map │ │ ├── index.js.efd089876b08c80349d0.hot-update.js │ │ ├── index.js.efd089876b08c80349d0.hot-update.js.map │ │ ├── index.js.f0b267c9387f14cd18b8.hot-update.js │ │ ├── index.js.f0b267c9387f14cd18b8.hot-update.js.map │ │ ├── index.js.f1f70d1e8b0a90fb6608.hot-update.js │ │ ├── index.js.f1f70d1e8b0a90fb6608.hot-update.js.map │ │ ├── index.js.f76db252ae5d756f576e.hot-update.js │ │ ├── index.js.f76db252ae5d756f576e.hot-update.js.map │ │ ├── index.js.f9a59798a8907b2e7b0d.hot-update.js │ │ ├── index.js.f9a59798a8907b2e7b0d.hot-update.js.map │ │ ├── index.js.fb7333a24414e8cb98d1.hot-update.js │ │ ├── index.js.fb7333a24414e8cb98d1.hot-update.js.map │ │ ├── index.js.fb86b8c0adc87afde0e6.hot-update.js │ │ ├── index.js.fb86b8c0adc87afde0e6.hot-update.js.map │ │ ├── index.js.fbc951b0463b535dd01d.hot-update.js │ │ ├── index.js.fbc951b0463b535dd01d.hot-update.js.map │ │ ├── index.js.fc6df17198cf75a09ea6.hot-update.js │ │ ├── index.js.fc6df17198cf75a09ea6.hot-update.js.map │ │ ├── index.js.fc849e50a4e73ac727b4.hot-update.js │ │ ├── index.js.fc849e50a4e73ac727b4.hot-update.js.map │ │ ├── index.js.ff25b82d875169052f53.hot-update.js │ │ └── index.js.ff25b82d875169052f53.hot-update.js.map └── index.html ├── example ├── lib │ └── util.js ├── next.config.js ├── package.json └── pages │ └── index.js ├── package.json ├── use-state-if-mounted ├── .babelrc ├── .gitignore ├── .npmignore ├── README.md ├── index.d.ts ├── package.json └── src │ ├── index.js │ ├── useIsComponentMounted.js │ └── useStateIfMounted.js └── yarn.lock /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 3 | 4 | name: Publish on npm 5 | 6 | on: 7 | push: 8 | branches: [ master ] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: actions/setup-node@v1 16 | with: 17 | node-version: 12 18 | - run: yarn install --frozen-lockfile 19 | - run: yarn build:hook 20 | 21 | publish-npm: 22 | needs: build 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: actions/checkout@v2 26 | - uses: actions/setup-node@v1 27 | with: 28 | node-version: 12 29 | registry-url: https://registry.npmjs.org/ 30 | - run: yarn install --frozen-lockfile 31 | - run: yarn build:hook 32 | - run: npm publish 33 | working-directory: use-state-if-mounted 34 | env: 35 | NPM_AUTH_TOKEN: ${{secrets.npm_token}} 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | yarn-error.log 2 | 3 | .next 4 | node_modules 5 | out -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Nans Dumortier 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🧰 useCustomHook: React Hook Starter 2 | 3 | A starter template for creating a new React Hook. 4 | 5 | ## 🚀 Getting Started 6 | 7 | ### tl;dr 8 | * `git clone https://github.com/colbyfayock/use-custom-hook [directory]` 9 | * `cd [directory]` 10 | * `yarn install && yarn setup` 11 | * `cd [hook-name] && npm publish` 12 | 13 | ### Set up a new repository 14 | * Clone the `useCustomHook` repo locally and navigate to the project 15 | 16 | ``` 17 | git clone https://github.com/colbyfayock/use-custom-hook [directory] 18 | cd [directory] 19 | ``` 20 | 21 | * Install packages 22 | 23 | ``` 24 | yarn install 25 | ``` 26 | 27 | * Run setup scripts 28 | 29 | ``` 30 | yarn setup 31 | ``` 32 | 33 | During this process, the scripts will ask you for your name and your custom hook's name, including both a camelCase variation (useCustomHook) and a snake-case variation (use-custom-hook). 34 | 35 | It will replace all instances of the default useCustomHook name with your chosen name. Additionally, it will replace the name in the license and author name in the hook's `package.json` file with your name. 36 | 37 | Lastly, the script will clean up the setup scripts and reset the git history with a fresh commit. 38 | 39 | This can only be ran once, as it will clean up the script files immediately after running. 40 | 41 | Make sure you remember to update your email address, author URL, git addresses, and anything else within the `[hook-name]/package.json` file. 42 | 43 | ### Developing with your hook 44 | Running `yarn develop` in the root of this project will kick off a watch command in both the `example` and hook workspaces. This means any time you make a change to the hook, it will build, and subsequently, your example page will refresh with that new hook build. 45 | 46 | ### Updating the example 47 | There's an example app set up in the `example` directory. You can use this space to add examples and any preferred documentation for your custom hook. 48 | 49 | ### Publishing 50 | * Navigate to your hook directory (default is use-custom-hook) 51 | 52 | ``` 53 | cd [hook-name] 54 | ``` 55 | 56 | * Log in to npm 57 | 58 | ``` 59 | npm login 60 | ``` 61 | 62 | * Publish 🎉 63 | 64 | ``` 65 | npm publish 66 | ``` 67 | 68 | ### Depliying your example 69 | Running `yarn build` in the root directory will create a new static build of the example website available in the `example/out` folder. This is standard HTML that can be uploaded to any static hosting software. 70 | -------------------------------------------------------------------------------- /docs/404.html: -------------------------------------------------------------------------------- 1 |

404

This page could not be found.

-------------------------------------------------------------------------------- /docs/404/index.html: -------------------------------------------------------------------------------- 1 |

404

This page could not be found.

-------------------------------------------------------------------------------- /docs/_next/static/4sqlbClfUSlXTJdWiI9ED/_buildManifest.js: -------------------------------------------------------------------------------- 1 | self.__BUILD_MANIFEST = {};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/4sqlbClfUSlXTJdWiI9ED/_ssgManifest.js: -------------------------------------------------------------------------------- 1 | self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/4sqlbClfUSlXTJdWiI9ED/pages/_app.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{0:function(t,n,e){e("becm"),t.exports=e("bBV7")},"6jsY":function(t,n,e){"use strict";var r=e("SDJZ"),u=e("NToG"),o=e("K4DB"),a=e("+IV6"),c=e("eef+"),i=e("NthX");function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var s=e("63Ad");n.__esModule=!0,n.Container=function(t){0;return t.children},n.createUrl=v,n.default=void 0;var f=s(e("mXGw")),l=e("z4BS");function h(t){var n,e,r;return i.async((function(u){for(;;)switch(u.prev=u.next){case 0:return n=t.Component,e=t.ctx,u.next=3,i.awrap((0,l.loadGetInitialProps)(n,e));case 3:return r=u.sent,u.abrupt("return",{pageProps:r});case 5:case"end":return u.stop()}}),null,null,null,Promise)}n.AppInitialProps=l.AppInitialProps;var d=function(t){c(i,t);var n,e=(n=i,function(){var t,e=a(n);if(p()){var r=a(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return o(this,t)});function i(){return r(this,i),e.apply(this,arguments)}return u(i,[{key:"componentDidCatch",value:function(t,n){throw t}},{key:"render",value:function(){var t=this.props,n=t.router,e=t.Component,r=t.pageProps,u=t.__N_SSG,o=t.__N_SSP;return f.default.createElement(e,Object.assign({},r,u||o?{}:{url:v(n)}))}}]),i}(f.default.Component);function v(t){var n=t.pathname,e=t.asPath,r=t.query;return{get query(){return r},get pathname(){return n},get asPath(){return e},back:function(){t.back()},push:function(n,e){return t.push(n,e)},pushTo:function(n,e){var r=e?n:"",u=e||n;return t.push(r,u)},replace:function(n,e){return t.replace(n,e)},replaceTo:function(n,e){var r=e?n:"",u=e||n;return t.replace(r,u)}}}n.default=d,d.origGetInitialProps=h,d.getInitialProps=h},becm:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return e("6jsY")}])}},[[0,0,1,2]]]); -------------------------------------------------------------------------------- /docs/_next/static/5pcoQMCK8ydsudtiq7kxB/_buildManifest.js: -------------------------------------------------------------------------------- 1 | self.__BUILD_MANIFEST = {};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/5pcoQMCK8ydsudtiq7kxB/_ssgManifest.js: -------------------------------------------------------------------------------- 1 | self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/5pcoQMCK8ydsudtiq7kxB/pages/_app.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{0:function(t,n,e){e("becm"),t.exports=e("bBV7")},"6jsY":function(t,n,e){"use strict";var r=e("SDJZ"),u=e("NToG"),o=e("K4DB"),a=e("+IV6"),c=e("eef+"),i=e("NthX");function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var s=e("63Ad");n.__esModule=!0,n.Container=function(t){0;return t.children},n.createUrl=v,n.default=void 0;var f=s(e("mXGw")),l=e("z4BS");function h(t){var n,e,r;return i.async((function(u){for(;;)switch(u.prev=u.next){case 0:return n=t.Component,e=t.ctx,u.next=3,i.awrap((0,l.loadGetInitialProps)(n,e));case 3:return r=u.sent,u.abrupt("return",{pageProps:r});case 5:case"end":return u.stop()}}),null,null,null,Promise)}n.AppInitialProps=l.AppInitialProps;var d=function(t){c(i,t);var n,e=(n=i,function(){var t,e=a(n);if(p()){var r=a(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return o(this,t)});function i(){return r(this,i),e.apply(this,arguments)}return u(i,[{key:"componentDidCatch",value:function(t,n){throw t}},{key:"render",value:function(){var t=this.props,n=t.router,e=t.Component,r=t.pageProps,u=t.__N_SSG,o=t.__N_SSP;return f.default.createElement(e,Object.assign({},r,u||o?{}:{url:v(n)}))}}]),i}(f.default.Component);function v(t){var n=t.pathname,e=t.asPath,r=t.query;return{get query(){return r},get pathname(){return n},get asPath(){return e},back:function(){t.back()},push:function(n,e){return t.push(n,e)},pushTo:function(n,e){var r=e?n:"",u=e||n;return t.push(r,u)},replace:function(n,e){return t.replace(n,e)},replaceTo:function(n,e){var r=e?n:"",u=e||n;return t.replace(r,u)}}}n.default=d,d.origGetInitialProps=h,d.getInitialProps=h},becm:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return e("6jsY")}])}},[[0,0,1,2]]]); -------------------------------------------------------------------------------- /docs/_next/static/BPOEM54sG5rOVcTk_zZGp/_buildManifest.js: -------------------------------------------------------------------------------- 1 | self.__BUILD_MANIFEST = {};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/BPOEM54sG5rOVcTk_zZGp/_ssgManifest.js: -------------------------------------------------------------------------------- 1 | self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/BPOEM54sG5rOVcTk_zZGp/pages/_app.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{0:function(t,n,e){e("becm"),t.exports=e("bBV7")},"6jsY":function(t,n,e){"use strict";var r=e("SDJZ"),u=e("NToG"),o=e("K4DB"),a=e("+IV6"),c=e("eef+"),i=e("NthX");function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var s=e("63Ad");n.__esModule=!0,n.Container=function(t){0;return t.children},n.createUrl=v,n.default=void 0;var f=s(e("mXGw")),l=e("z4BS");function h(t){var n,e,r;return i.async((function(u){for(;;)switch(u.prev=u.next){case 0:return n=t.Component,e=t.ctx,u.next=3,i.awrap((0,l.loadGetInitialProps)(n,e));case 3:return r=u.sent,u.abrupt("return",{pageProps:r});case 5:case"end":return u.stop()}}),null,null,null,Promise)}n.AppInitialProps=l.AppInitialProps;var d=function(t){c(i,t);var n,e=(n=i,function(){var t,e=a(n);if(p()){var r=a(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return o(this,t)});function i(){return r(this,i),e.apply(this,arguments)}return u(i,[{key:"componentDidCatch",value:function(t,n){throw t}},{key:"render",value:function(){var t=this.props,n=t.router,e=t.Component,r=t.pageProps,u=t.__N_SSG,o=t.__N_SSP;return f.default.createElement(e,Object.assign({},r,u||o?{}:{url:v(n)}))}}]),i}(f.default.Component);function v(t){var n=t.pathname,e=t.asPath,r=t.query;return{get query(){return r},get pathname(){return n},get asPath(){return e},back:function(){t.back()},push:function(n,e){return t.push(n,e)},pushTo:function(n,e){var r=e?n:"",u=e||n;return t.push(r,u)},replace:function(n,e){return t.replace(n,e)},replaceTo:function(n,e){var r=e?n:"",u=e||n;return t.replace(r,u)}}}n.default=d,d.origGetInitialProps=h,d.getInitialProps=h},becm:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return e("6jsY")}])}},[[0,0,1,2]]]); -------------------------------------------------------------------------------- /docs/_next/static/RnUve1OqxCMPWcfLP9XLT/_buildManifest.js: -------------------------------------------------------------------------------- 1 | self.__BUILD_MANIFEST = {};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/RnUve1OqxCMPWcfLP9XLT/_ssgManifest.js: -------------------------------------------------------------------------------- 1 | self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/RnUve1OqxCMPWcfLP9XLT/pages/_app.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{0:function(t,n,e){e("becm"),t.exports=e("bBV7")},"6jsY":function(t,n,e){"use strict";var r=e("SDJZ"),u=e("NToG"),o=e("K4DB"),a=e("+IV6"),c=e("eef+"),i=e("NthX");function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var s=e("63Ad");n.__esModule=!0,n.Container=function(t){0;return t.children},n.createUrl=v,n.default=void 0;var f=s(e("mXGw")),l=e("z4BS");function h(t){var n,e,r;return i.async((function(u){for(;;)switch(u.prev=u.next){case 0:return n=t.Component,e=t.ctx,u.next=3,i.awrap((0,l.loadGetInitialProps)(n,e));case 3:return r=u.sent,u.abrupt("return",{pageProps:r});case 5:case"end":return u.stop()}}),null,null,null,Promise)}n.AppInitialProps=l.AppInitialProps;var d=function(t){c(i,t);var n,e=(n=i,function(){var t,e=a(n);if(p()){var r=a(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return o(this,t)});function i(){return r(this,i),e.apply(this,arguments)}return u(i,[{key:"componentDidCatch",value:function(t,n){throw t}},{key:"render",value:function(){var t=this.props,n=t.router,e=t.Component,r=t.pageProps,u=t.__N_SSG,o=t.__N_SSP;return f.default.createElement(e,Object.assign({},r,u||o?{}:{url:v(n)}))}}]),i}(f.default.Component);function v(t){var n=t.pathname,e=t.asPath,r=t.query;return{get query(){return r},get pathname(){return n},get asPath(){return e},back:function(){t.back()},push:function(n,e){return t.push(n,e)},pushTo:function(n,e){var r=e?n:"",u=e||n;return t.push(r,u)},replace:function(n,e){return t.replace(n,e)},replaceTo:function(n,e){var r=e?n:"",u=e||n;return t.replace(r,u)}}}n.default=d,d.origGetInitialProps=h,d.getInitialProps=h},becm:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return e("6jsY")}])}},[[0,0,1,2]]]); -------------------------------------------------------------------------------- /docs/_next/static/chunks/0.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{ 2 | 3 | /***/ "../node_modules/next/dist/client/dev/noop.js": 4 | /*!****************************************************!*\ 5 | !*** ../node_modules/next/dist/client/dev/noop.js ***! 6 | \****************************************************/ 7 | /*! no static exports found */ 8 | /***/ (function(module, exports, __webpack_require__) { 9 | 10 | "use strict"; 11 | 12 | 13 | /***/ }) 14 | 15 | }]); 16 | //# sourceMappingURL=0.js.map -------------------------------------------------------------------------------- /docs/_next/static/chunks/0.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/chunks/0.js","sources":[],"mappings":";;;;;;;;;;;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/dYfIn4-TShReIX9hubX9J/_buildManifest.js: -------------------------------------------------------------------------------- 1 | self.__BUILD_MANIFEST = {};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/dYfIn4-TShReIX9hubX9J/_ssgManifest.js: -------------------------------------------------------------------------------- 1 | self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/dYfIn4-TShReIX9hubX9J/pages/_app.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{0:function(t,n,e){e("becm"),t.exports=e("bBV7")},"6jsY":function(t,n,e){"use strict";var r=e("SDJZ"),u=e("NToG"),o=e("K4DB"),a=e("+IV6"),c=e("eef+"),i=e("NthX");function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var s=e("63Ad");n.__esModule=!0,n.Container=function(t){0;return t.children},n.createUrl=v,n.default=void 0;var f=s(e("mXGw")),l=e("z4BS");function h(t){var n,e,r;return i.async((function(u){for(;;)switch(u.prev=u.next){case 0:return n=t.Component,e=t.ctx,u.next=3,i.awrap((0,l.loadGetInitialProps)(n,e));case 3:return r=u.sent,u.abrupt("return",{pageProps:r});case 5:case"end":return u.stop()}}),null,null,null,Promise)}n.AppInitialProps=l.AppInitialProps;var d=function(t){c(i,t);var n,e=(n=i,function(){var t,e=a(n);if(p()){var r=a(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return o(this,t)});function i(){return r(this,i),e.apply(this,arguments)}return u(i,[{key:"componentDidCatch",value:function(t,n){throw t}},{key:"render",value:function(){var t=this.props,n=t.router,e=t.Component,r=t.pageProps,u=t.__N_SSG,o=t.__N_SSP;return f.default.createElement(e,Object.assign({},r,u||o?{}:{url:v(n)}))}}]),i}(f.default.Component);function v(t){var n=t.pathname,e=t.asPath,r=t.query;return{get query(){return r},get pathname(){return n},get asPath(){return e},back:function(){t.back()},push:function(n,e){return t.push(n,e)},pushTo:function(n,e){var r=e?n:"",u=e||n;return t.push(r,u)},replace:function(n,e){return t.replace(n,e)},replaceTo:function(n,e){var r=e?n:"",u=e||n;return t.replace(r,u)}}}n.default=d,d.origGetInitialProps=h,d.getInitialProps=h},becm:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return e("6jsY")}])}},[[0,0,1,2]]]); -------------------------------------------------------------------------------- /docs/_next/static/development/_buildManifest.js: -------------------------------------------------------------------------------- 1 | self.__BUILD_MANIFEST = {};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/development/_ssgManifest.js: -------------------------------------------------------------------------------- 1 | self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/kZGawXPz4M7fsaH_w9E8C/_buildManifest.js: -------------------------------------------------------------------------------- 1 | self.__BUILD_MANIFEST = {};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/kZGawXPz4M7fsaH_w9E8C/_ssgManifest.js: -------------------------------------------------------------------------------- 1 | self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() -------------------------------------------------------------------------------- /docs/_next/static/kZGawXPz4M7fsaH_w9E8C/pages/_app.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{0:function(t,n,e){e("becm"),t.exports=e("bBV7")},"6jsY":function(t,n,e){"use strict";var r=e("SDJZ"),u=e("NToG"),o=e("K4DB"),a=e("+IV6"),c=e("eef+"),i=e("NthX");function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var s=e("63Ad");n.__esModule=!0,n.Container=function(t){0;return t.children},n.createUrl=v,n.default=void 0;var f=s(e("mXGw")),l=e("z4BS");function h(t){var n,e,r;return i.async((function(u){for(;;)switch(u.prev=u.next){case 0:return n=t.Component,e=t.ctx,u.next=3,i.awrap((0,l.loadGetInitialProps)(n,e));case 3:return r=u.sent,u.abrupt("return",{pageProps:r});case 5:case"end":return u.stop()}}),null,null,null,Promise)}n.AppInitialProps=l.AppInitialProps;var d=function(t){c(i,t);var n,e=(n=i,function(){var t,e=a(n);if(p()){var r=a(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return o(this,t)});function i(){return r(this,i),e.apply(this,arguments)}return u(i,[{key:"componentDidCatch",value:function(t,n){throw t}},{key:"render",value:function(){var t=this.props,n=t.router,e=t.Component,r=t.pageProps,u=t.__N_SSG,o=t.__N_SSP;return f.default.createElement(e,Object.assign({},r,u||o?{}:{url:v(n)}))}}]),i}(f.default.Component);function v(t){var n=t.pathname,e=t.asPath,r=t.query;return{get query(){return r},get pathname(){return n},get asPath(){return e},back:function(){t.back()},push:function(n,e){return t.push(n,e)},pushTo:function(n,e){var r=e?n:"",u=e||n;return t.push(r,u)},replace:function(n,e){return t.replace(n,e)},replaceTo:function(n,e){var r=e?n:"",u=e||n;return t.replace(r,u)}}}n.default=d,d.origGetInitialProps=h,d.getInitialProps=h},becm:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return e("6jsY")}])}},[[0,0,1,2]]]); -------------------------------------------------------------------------------- /docs/_next/static/runtime/webpack-b65cab0b00afd201cbda.js: -------------------------------------------------------------------------------- 1 | !function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's useState\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.0aed3914e726ed4bff13.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.0aed3914e726ed4bff13.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , but this one hook only updates state \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.17d7b66f7ed9253fd2ae.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.17d7b66f7ed9253fd2ae.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , but this one ho\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.1c2797b5a0251264c327.hot-update.js: -------------------------------------------------------------------------------- 1 | webpackHotUpdate("static/development/pages/index.js",{ 2 | 3 | /***/ "../use-state-if-mounted/package.json": 4 | /*!********************************************!*\ 5 | !*** ../use-state-if-mounted/package.json ***! 6 | \********************************************/ 7 | /*! exports provided: name, version, description, author, keywords, main, scripts, license, devDependencies, repository, bugs, default */ 8 | /***/ (function(module) { 9 | 10 | module.exports = JSON.parse("{\"name\":\"use-state-if-mounted\",\"version\":\"1.0.1\",\"description\":\"A hook for updating state only if the component is mounted\",\"author\":{\"name\":\"Nans Dumortier\",\"email\":\"dumortier.nans@gmail.com\",\"url\":\"https://github.com/NansD/\"},\"keywords\":[\"react\",\"hooks\",\"react-hooks\",\"useState\",\"isMounted\"],\"main\":\"index.js\",\"scripts\":{\"build\":\"babel src --out-dir .\",\"bump\":\"npm version\",\"example\":\"cd example && yarn install && yarn package\",\"prepublishOnly\":\"yarn build\",\"watch\":\"nodemon --watch src --exec \\\"yarn build\\\"\"},\"license\":\"MIT\",\"devDependencies\":{\"@babel/cli\":\"^7.8.4\",\"@babel/core\":\"^7.9.0\",\"@babel/preset-env\":\"^7.9.0\",\"@babel/preset-react\":\"^7.9.4\",\"nodemon\":\"^2.0.2\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/nansD/use-state-if-mounted\"},\"bugs\":{\"url\":\"https://github.com/nansD/use-state-if-mounted/issues\"}}"); 11 | 12 | /***/ }) 13 | 14 | }) 15 | //# sourceMappingURL=index.js.1c2797b5a0251264c327.hot-update.js.map -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.1c2797b5a0251264c327.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.1c2797b5a0251264c327.hot-update.js","sources":[],"mappings":";;;;;;;;;;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.219b1c0597e915c720f1.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.219b1c0597e915c720f1.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.26bcdde27e3b2514fde2.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.26bcdde27e3b2514fde2.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.2a0edb30b7410e3404dd.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.2a0edb30b7410e3404dd.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.3ad6fd737417f6cd4912.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.3ad6fd737417f6cd4912.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Use this hook just like React's \n \n useState\n \n . This one hook only updates state if the component that called this hook is mounted.\n This allows us to avoid memory leaks\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.40b98d9fe4a3e60a51c5.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.40b98d9fe4a3e60a51c5.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import { useStateIfMounted } from '../../use-state-if-mounted';\n\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Add your instructions here!\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.4d27eccb94350f45c726.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.4d27eccb94350f45c726.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import { useStateIfMounted } from '../../use-state-if-mounted';\nimport Head from 'next/head';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Add your instructions here!\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.4e68e35c7c9b80da491d.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.4e68e35c7c9b80da491d.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Add your instructions here!\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.6485b480921d02bc37d8.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.6485b480921d02bc37d8.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import { useStateIfMounted } from '../../use-state-if-mounted';\n\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Add your instructions here!\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n          \n{`const hookSettings = {\n  message: 'Hello, custom hook!'\n}\n\nconst { message } = useStateIfMounted(hookSettings);`}\n          \n        
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.6858dab54b9a3b836abb.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.6858dab54b9a3b836abb.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , but this one hook only updates state if the component that called this hook is mounted.\n \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.6afd52a4a0dced85fcf4.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.6afd52a4a0dced85fcf4.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Use this hook just like React's \n \n useState\n \n , but this one hook only updates state if the component that called this hook is mounted.\n This allows us to avoid memory leaks\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.7040a7f0f467a30cb495.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.7040a7f0f467a30cb495.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , expect\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.715d6aba915415315a0e.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.715d6aba915415315a0e.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import { useStateIfMounted } from '../../use-state-if-mounted';\n\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Add your instructions here!\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.9020cae4abf5f01be613.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.9020cae4abf5f01be613.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import { useStateIfMounted } from '../../use-state-if-mounted';\n\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Add your instructions here!\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.91bfc83fd2525db8961e.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.91bfc83fd2525db8961e.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , except \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.976d703e5ae2f2375380.hot-update.js: -------------------------------------------------------------------------------- 1 | webpackHotUpdate("static/development/pages/index.js",{ 2 | 3 | /***/ "../use-state-if-mounted/package.json": 4 | /*!********************************************!*\ 5 | !*** ../use-state-if-mounted/package.json ***! 6 | \********************************************/ 7 | /*! exports provided: name, version, description, author, keywords, main, scripts, license, devDependencies, repository, bugs, default */ 8 | /***/ (function(module) { 9 | 10 | module.exports = JSON.parse("{\"name\":\"use-state-if-mounted\",\"version\":\"1.0.1\",\"description\":\"A hook for updating state only if the component is mounted\",\"author\":{\"name\":\"Nans Dumortier\",\"email\":\"dumortier.nans@gmail.com\",\"url\":\"https://github.com/NansD/\"},\"keywords\":[\"react\",\"hooks\",\"react-hooks\",\"useState\",\"isMounted\"],\"main\":\"index.js\",\"scripts\":{\"build\":\"babel src --out-dir .\",\"bump\":\"npm version\",\"example\":\"cd example && yarn install && yarn package\",\"prepublishOnly\":\"yarn build\",\"watch\":\"nodemon --watch src --exec \\\"yarn build\\\"\"},\"license\":\"MIT\",\"devDependencies\":{\"@babel/cli\":\"^7.8.4\",\"@babel/core\":\"^7.9.0\",\"@babel/preset-env\":\"^7.9.0\",\"@babel/preset-react\":\"^7.9.4\",\"nodemon\":\"^2.0.2\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/NansD/use-state-if-mounted\"},\"bugs\":{\"url\":\"https://github.com/NansD/use-state-if-mounted/issues\"}}"); 11 | 12 | /***/ }) 13 | 14 | }) 15 | //# sourceMappingURL=index.js.976d703e5ae2f2375380.hot-update.js.map -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.976d703e5ae2f2375380.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.976d703e5ae2f2375380.hot-update.js","sources":[],"mappings":";;;;;;;;;;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.9808bfee36bcfd4f5a16.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.9808bfee36bcfd4f5a16.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import { useStateIfMounted } from '../../use-state-if-mounted';\n\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (<>\n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Add your instructions here!\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n          \n{`const hookSettings = {\n  message: 'Hello, custom hook!'\n}\n\nconst { message } = useStateIfMounted(hookSettings);`}\n          \n        
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.98dc7d550708bdf1043b.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.98dc7d550708bdf1043b.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import { useStateIfMounted } from '../../use-state-if-mounted';\n\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Add your instructions here!\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.9afad189f4a73a44d14d.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.9afad189f4a73a44d14d.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , but this one hook only updates state if the component that called this hook is mounted.\n This allow\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.9e472434a10c3e1373d4.hot-update.js: -------------------------------------------------------------------------------- 1 | webpackHotUpdate("static/development/pages/index.js",{ 2 | 3 | /***/ "../use-state-if-mounted/package.json": 4 | /*!********************************************!*\ 5 | !*** ../use-state-if-mounted/package.json ***! 6 | \********************************************/ 7 | /*! exports provided: name, version, description, author, keywords, main, scripts, license, devDependencies, repository, bugs, default */ 8 | /***/ (function(module) { 9 | 10 | module.exports = JSON.parse("{\"name\":\"use-state-if-mounted\",\"version\":\"1.0.1\",\"description\":\"A hook for updating state only if the component is mounted\",\"author\":{\"name\":\"Nans Dumortier\",\"email\":\"dumortier.nans@gmail.com\",\"url\":\"https://github.com/NansD/\"},\"keywords\":[\"react\",\"hooks\",\"react-hooks\",\"useState\",\"isMounted\"],\"main\":\"index.js\",\"scripts\":{\"build\":\"babel src --out-dir .\",\"bump\":\"npm version\",\"example\":\"cd example && yarn install && yarn package\",\"prepublishOnly\":\"yarn build\",\"watch\":\"nodemon --watch src --exec \\\"yarn build\\\"\"},\"license\":\"MIT\",\"devDependencies\":{\"@babel/cli\":\"^7.8.4\",\"@babel/core\":\"^7.9.0\",\"@babel/preset-env\":\"^7.9.0\",\"@babel/preset-react\":\"^7.9.4\",\"nodemon\":\"^2.0.2\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/NansD/use-state-if-mounted\"},\"bugs\":{\"url\":\"https://github.com/nansD/use-state-if-mounted/issues\"}}"); 11 | 12 | /***/ }) 13 | 14 | }) 15 | //# sourceMappingURL=index.js.9e472434a10c3e1373d4.hot-update.js.map -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.9e472434a10c3e1373d4.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.9e472434a10c3e1373d4.hot-update.js","sources":[],"mappings":";;;;;;;;;;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.a6be95e6c8786019f248.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.a6be95e6c8786019f248.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , but this one hook only updates state if \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.b45eb7170ee96231e1ad.hot-update.js: -------------------------------------------------------------------------------- 1 | webpackHotUpdate("static/development/pages/index.js",{ 2 | 3 | /***/ "../use-state-if-mounted/package.json": 4 | /*!********************************************!*\ 5 | !*** ../use-state-if-mounted/package.json ***! 6 | \********************************************/ 7 | /*! exports provided: name, version, description, author, keywords, main, scripts, license, devDependencies, repository, bugs, default */ 8 | /***/ (function(module) { 9 | 10 | module.exports = JSON.parse("{\"name\":\"use-state-if-mounted\",\"version\":\"1.0.1\",\"description\":\"A hook for updating state only if the component is mounted.\",\"author\":{\"name\":\"Nans Dumortier\",\"email\":\"dumortier.nans@gmail.com\",\"url\":\"https://github.com/NansD/\"},\"keywords\":[\"react\",\"hooks\",\"react-hooks\",\"useState\",\"isMounted\"],\"main\":\"index.js\",\"scripts\":{\"build\":\"babel src --out-dir .\",\"bump\":\"npm version\",\"example\":\"cd example && yarn install && yarn package\",\"prepublishOnly\":\"yarn build\",\"watch\":\"nodemon --watch src --exec \\\"yarn build\\\"\"},\"license\":\"MIT\",\"devDependencies\":{\"@babel/cli\":\"^7.8.4\",\"@babel/core\":\"^7.9.0\",\"@babel/preset-env\":\"^7.9.0\",\"@babel/preset-react\":\"^7.9.4\",\"nodemon\":\"^2.0.2\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/NansD/use-state-if-mounted\"},\"bugs\":{\"url\":\"https://github.com/NansD/use-state-if-mounted/issues\"}}"); 11 | 12 | /***/ }) 13 | 14 | }) 15 | //# sourceMappingURL=index.js.b45eb7170ee96231e1ad.hot-update.js.map -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.b45eb7170ee96231e1ad.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.b45eb7170ee96231e1ad.hot-update.js","sources":[],"mappings":";;;;;;;;;;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.b69697f32a514207a4b0.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.b69697f32a514207a4b0.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from \"next/head\";\n\nimport { useStateIfMounted } from \"../../use-state-if-mounted\";\nimport { toCamel } from \"../lib/util\";\n\nimport hookConfig from \"../../use-state-if-mounted/package.json\";\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === \"string\";\n\n const repositoryUrlDisplay =\n repositoryExists && repositoryUrl.split(\"://\")[1];\n\n\n const [count, setCount] = useStateIfMounted(0);\n console.log('setCount :', setCount);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n

{toCamel(name)}

\n\n

{description}

\n\n {repositoryExists && (\n

\n {repositoryUrlDisplay}\n

\n )}\n\n

How to use

\n\n

\n Use this hook just like React's \n \n useState\n \n .\n

\n

\n This one hook only updates state if the component that called this\n hook is mounted. This allows us to avoid memory leaks and messages\n like this one :\n

\n \n Warning: Can't perform a React state update on an unmounted\n component. This is a no-op, but it indicates a memory leak in your\n application. To fix, cancel all subscriptions and asynchronous tasks\n in a useEffect cleanup function. in Child (created by Holder)\n \n\n

Examples

\n\n

\n Input:\n

\n
\n            \n              {`\nconst [count, setCount] = useStateIfMounted(0);`}\n            \n          
\n
\n\n \n
\n \n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AACA;AATA;AAAA;AAAA;AAAA;AACA;AAYA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.b9af64d2fe4223d0afd0.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.b9af64d2fe4223d0afd0.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , but this one hook only updates state if the component that called this hook is mounted.\n This helps \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.c503a3bbb0b4d64df54a.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.c503a3bbb0b4d64df54a.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.c91d389155b6d1b2edc9.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.c91d389155b6d1b2edc9.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.cc39d7d5dd5d2d66d175.hot-update.js: -------------------------------------------------------------------------------- 1 | webpackHotUpdate("static/development/pages/index.js",{ 2 | 3 | /***/ "../use-state-if-mounted/package.json": 4 | /*!********************************************!*\ 5 | !*** ../use-state-if-mounted/package.json ***! 6 | \********************************************/ 7 | /*! exports provided: name, version, description, author, keywords, main, scripts, license, devDependencies, repository, bugs, default */ 8 | /***/ (function(module) { 9 | 10 | module.exports = JSON.parse("{\"name\":\"use-state-if-mounted\",\"version\":\"1.0.1\",\"description\":\"A hook for updating state only if the component is mounted\",\"author\":{\"name\":\"Nans Dumortier\",\"email\":\"dumortier.nans@gmail.com\",\"url\":\"https://github.com/NansD/\"},\"keywords\":[\"react\",\"hooks\",\"react-hooks\",\"useState\",\"isMounted\"],\"main\":\"index.js\",\"scripts\":{\"build\":\"babel src --out-dir .\",\"bump\":\"npm version\",\"example\":\"cd example && yarn install && yarn package\",\"prepublishOnly\":\"yarn build\",\"watch\":\"nodemon --watch src --exec \\\"yarn build\\\"\"},\"license\":\"MIT\",\"devDependencies\":{\"@babel/cli\":\"^7.8.4\",\"@babel/core\":\"^7.9.0\",\"@babel/preset-env\":\"^7.9.0\",\"@babel/preset-react\":\"^7.9.4\",\"nodemon\":\"^2.0.2\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/nans/use-state-if-mounted\"},\"bugs\":{\"url\":\"https://github.com/nans/use-state-if-mounted/issues\"}}"); 11 | 12 | /***/ }) 13 | 14 | }) 15 | //# sourceMappingURL=index.js.cc39d7d5dd5d2d66d175.hot-update.js.map -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.cc39d7d5dd5d2d66d175.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.cc39d7d5dd5d2d66d175.hot-update.js","sources":[],"mappings":";;;;;;;;;;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.cdaead03c4bd32ae77b4.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.cdaead03c4bd32ae77b4.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , but this one hook\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.d9e0c598d8cb970224bb.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.d9e0c598d8cb970224bb.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import { useStateIfMounted } from '../../use-state-if-mounted';\n\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n My page title\n \n \n \n \n \n

Hello world!

\n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Add your instructions here!\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.e0074df4a59d9c2b8f9f.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.e0074df4a59d9c2b8f9f.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's \n \n useState\n \n , but this one hook only updates state if the component that called this hook is mounted.\n This allows us to avoid memory leaks\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.e74c7e0f7f6683cf78e9.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.e74c7e0f7f6683cf78e9.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Use this hook just like React's \n \n useState\n \n this one hook only updates state if the component that called this hook is mounted.\n This allows us to avoid memory leaks\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.efd089876b08c80349d0.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.efd089876b08c80349d0.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , but this one hook \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.f76db252ae5d756f576e.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.f76db252ae5d756f576e.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , but this one hook only updates state if the component that called this hook is mounted.\n This allows us to avoid \n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.f9a59798a8907b2e7b0d.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.f9a59798a8907b2e7b0d.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import Head from 'next/head';\n\nimport { useStateIfMounted } from '../../use-state-if-mounted';\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n Hook - useStateIfMounted\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Just like React's\n \n useState\n \n , but this one hook only updates state if the component that called this hook is mounted.\n This allows us to avoid memory leaks\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /docs/_next/static/webpack/static/development/pages/index.js.fc849e50a4e73ac727b4.hot-update.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/webpack/static/development/pages/index.js.fc849e50a4e73ac727b4.hot-update.js","sources":["webpack:///./pages/index.js"],"sourcesContent":["import { useStateIfMounted } from '../../use-state-if-mounted';\n\nimport { toCamel } from '../lib/util';\n\nimport hookConfig from '../../use-state-if-mounted/package.json';\n\nexport default function Index() {\n const { name, description, repository = {}, author = {} } = hookConfig;\n\n const { name: authorName, url: authorUrl } = author;\n\n const { url: repositoryUrl } = repository;\n const repositoryExists = typeof repositoryUrl === 'string';\n\n const repositoryUrlDisplay = repositoryExists && repositoryUrl.split('://')[1];\n\n const hookSettings = {\n message: 'Hello, custom hook!'\n }\n\n const { message } = useStateIfMounted(hookSettings);\n\n return (\n <>\n \n My page title\n \n \n \n \n \n
\n \n\n
\n\n

{ toCamel(name) }

\n\n

{ description }

\n\n { repositoryExists && (\n

\n \n { repositoryUrlDisplay }\n \n

\n )}\n\n

How to use

\n\n

\n Add your instructions here!\n

\n\n

Examples

\n\n

Set and grab message

\n

\n Input:\n

\n
\n            \n  {`const hookSettings = {\n    message: 'Hello, custom hook!'\n  }\n\n  const { message } = useStateIfMounted(hookSettings);`}\n            \n          
\n

\n Output:\n

\n

\n { message }\n

\n
\n\n \n
\n \n );\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAEA;AAEA;AACA;AADA;AACA;AAXA;AAAA;AACA;AAeA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;;;;A","sourceRoot":""} -------------------------------------------------------------------------------- /example/lib/util.js: -------------------------------------------------------------------------------- 1 | /** 2 | * toCamel 3 | * @description Convert a snake string to camel case 4 | * @via https://matthiashager.com/converting-snake-case-to-camel-case-object-keys-with-javascript 5 | */ 6 | 7 | export function toCamel(str) { 8 | return str.replace(/([-_][a-z])/ig, ($1) => { 9 | return $1.toUpperCase() 10 | .replace('-', '') 11 | .replace('_', ''); 12 | }); 13 | } -------------------------------------------------------------------------------- /example/next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | exportTrailingSlash: true, 3 | exportPathMap: function() { 4 | return { 5 | '/': { page: '/' } 6 | }; 7 | } 8 | }; -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "1.0.1", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "next build", 8 | "dev": "next", 9 | "develop": "yarn dev", 10 | "export": "next export", 11 | "package": "yarn build && yarn export", 12 | "refresh": "yarn install --force", 13 | "start": "next start" 14 | }, 15 | "keywords": [], 16 | "author": "", 17 | "license": "ISC", 18 | "dependencies": { 19 | "next": "^12.1.0", 20 | "react": "^16.13.1", 21 | "react-dom": "^16.13.1" 22 | }, 23 | "private": true 24 | } 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "workspaces": [ 4 | "example", 5 | "use-state-if-mounted" 6 | ], 7 | "scripts": { 8 | "build": "yarn build:hook && yarn build:example && cp -r ./example/out/ ./docs", 9 | "build:example": "yarn workspace example package", 10 | "build:hook": "yarn workspace use-state-if-mounted build", 11 | "bump": "yarn workspace use-state-if-mounted bump", 12 | "develop": "yarn watch", 13 | "watch": "concurrently -n Hook,Example \"yarn watch:hook\" \"yarn watch:example\"", 14 | "watch:example": "yarn workspace example develop", 15 | "watch:hook": "yarn workspace use-state-if-mounted watch" 16 | }, 17 | "devDependencies": { 18 | "concurrently": "^5.1.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /use-state-if-mounted/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env", "@babel/preset-react"] 3 | } -------------------------------------------------------------------------------- /use-state-if-mounted/.gitignore: -------------------------------------------------------------------------------- 1 | /*.js -------------------------------------------------------------------------------- /use-state-if-mounted/.npmignore: -------------------------------------------------------------------------------- 1 | yarn-error.log 2 | example 3 | node_modules 4 | src -------------------------------------------------------------------------------- /use-state-if-mounted/README.md: -------------------------------------------------------------------------------- 1 | # useStateIfMounted 2 | A hook for updating state only if the component is mounted. 3 | Find it on [npm](https://www.npmjs.com/package/use-state-if-mounted), or add it to your project : 4 | ```bash 5 | $ npm install use-state-if-mounted 6 | # or 7 | $ yarn add use-state-if-mounted 8 | ``` 9 | 10 | ---- 11 | 12 | ## 🔴 UPDATE 13 | 14 | This "solution" doesn't avoid leaks. Even AbortController doesn't seem to be the silver bullet against memory leaks 😰. 15 | Check out the [discussion in the comments](https://dev.to/nans/an-elegant-solution-for-memory-leaks-in-react-1hol)! 16 | 17 | ---- 18 | 19 | 20 | ## How to use 21 | Use this hook just like React's [useState](https://reactjs.org/docs/hooks-reference.html#usestate). 22 | 23 | This one hook only updates state if the component that called this hook is mounted. This allows us to avoid memory leaks and messages like this one : 24 | ``` 25 | Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. in Child (created by Holder) 26 | ``` 27 | 28 | ## Examples 29 | ### Basic usage 30 | ```javascript 31 | const [count, setCount] = useStateIfMounted(0); 32 | ``` 33 | 34 | ### "Real use case" usage 35 | Based from this [issue](https://github.com/facebook/react/issues/14113) from Github. 36 | 37 | ```javascript 38 | 39 | const apiCall = n => 40 | new Promise(resolve => setTimeout(() => resolve(n + 1), 3000)); 41 | 42 | const ShowApiCallResult = () => { 43 | const [n, setN] = useState(0); 44 | useEffect(() => { 45 | apiCall(n).then(newN => setN(newN)); 46 | }); 47 | 48 | return String(n); 49 | }; 50 | 51 | const RemoveComponentWithPendingApiCall = () => { 52 | const [show, setShow] = useState(true); 53 | return ( 54 | 55 | 56 | {show && } 57 | 58 | ); 59 | }; 60 | ``` 61 | See [CodeSandbox](https://codesandbox.io/s/vmm13qmw67?file=/src/index.js). 62 | 63 | The issue can be fixed with our hook by simply replacing `useState` with `useStateIfMounted` : 64 | 65 | 66 | 67 | ```javascript 68 | const apiCall = n => 69 | new Promise(resolve => setTimeout(() => resolve(n + 1), 3000)); 70 | 71 | const ShowApiCallResult = () => { 72 | const [n, setN] = useStateIfMounted(0); // notice the change 🚀 73 | useEffect(() => { 74 | apiCall(n).then(newN => setN(newN)); 75 | }); 76 | 77 | return String(n); 78 | }; 79 | 80 | const RemoveComponentWithPendingApiCall = () => { 81 | const [show, setShow] = useState(true); // this setShow will never cause a memory leak in this situation 82 | // so we can use vanilla setState 83 | return ( 84 | 85 | 86 | {show && } 87 | 88 | ); 89 | }; 90 | ``` 91 | 92 | See [CodeSandbox](https://codesandbox.io/s/gracious-mahavira-3k62q?file=/src/index.js). -------------------------------------------------------------------------------- /use-state-if-mounted/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Dispatch, SetStateAction } from 'react'; 2 | 3 | export function useStateIfMounted(initialState: S | (() => S)): [S, Dispatch>]; 4 | -------------------------------------------------------------------------------- /use-state-if-mounted/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "use-state-if-mounted", 3 | "version": "1.0.7", 4 | "description": "A hook for updating state only if the component is mounted.", 5 | "author": { 6 | "name": "Nans Dumortier", 7 | "email": "dumortier.nans@gmail.com", 8 | "url": "https://github.com/NansD/" 9 | }, 10 | "keywords": [ 11 | "react", 12 | "hooks", 13 | "react-hooks", 14 | "useState", 15 | "isMounted" 16 | ], 17 | "main": "index.js", 18 | "scripts": { 19 | "build": "babel src --out-dir .", 20 | "bump": "npm version", 21 | "example": "cd example && yarn install && yarn package", 22 | "prepublishOnly": "yarn build", 23 | "watch": "nodemon --watch src --exec \"yarn build\"" 24 | }, 25 | "license": "MIT", 26 | "devDependencies": { 27 | "@babel/cli": "^7.8.4", 28 | "@babel/core": "^7.9.0", 29 | "@babel/preset-env": "^7.9.0", 30 | "@babel/preset-react": "^7.9.4", 31 | "nodemon": "^2.0.2" 32 | }, 33 | "repository": { 34 | "type": "git", 35 | "url": "https://github.com/NansD/use-state-if-mounted" 36 | }, 37 | "bugs": { 38 | "url": "https://github.com/NansD/use-state-if-mounted/issues" 39 | }, 40 | "homepage": "https://nansd.github.io/use-state-if-mounted/" 41 | } 42 | -------------------------------------------------------------------------------- /use-state-if-mounted/src/index.js: -------------------------------------------------------------------------------- 1 | export { default as useStateIfMounted } from './useStateIfMounted'; -------------------------------------------------------------------------------- /use-state-if-mounted/src/useIsComponentMounted.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from 'react'; 2 | 3 | export default function useIsComponentMounted() { 4 | const isMounted = useRef(false); 5 | useEffect(() => { 6 | isMounted.current = true; 7 | return () => isMounted.current = false; 8 | }, []); 9 | return isMounted; 10 | }; 11 | -------------------------------------------------------------------------------- /use-state-if-mounted/src/useStateIfMounted.js: -------------------------------------------------------------------------------- 1 | import useIsComponentMounted from './useIsComponentMounted' 2 | import { useState, useCallback } from 'react'; 3 | 4 | 5 | /** 6 | * Like React's [useState](https://reactjs.org/docs/hooks-reference.html#usestate) 7 | * but it makes sure the component that uses this hook is mounted when updating state 8 | * 9 | * @see https://reactjs.org/docs/hooks-reference.html#usestate 10 | * @export 11 | * @param {any} initialValue 12 | * @returns {[any, Diapatch]} an array of 2 items 13 | * the first is the current state, the second is a state update function 14 | * that does nothing if the component is not mounted 15 | */ 16 | export default function useStateIfMounted (initialValue) { 17 | const isComponentMounted = useIsComponentMounted(); 18 | const [state, setState] = useState(initialValue); 19 | const newSetState = useCallback((value) => { 20 | if (isComponentMounted.current) { 21 | setState(value); 22 | } 23 | }, [isComponentMounted]); 24 | return [state, newSetState] 25 | } 26 | --------------------------------------------------------------------------------