{"_id":"use-inside","_rev":"38-c2b5ae73a8038f7c7794224de042ca8c","name":"use-inside","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"use-inside","version":"0.1.0","author":{"name":"Aragon Association","email":"legal@aragon.org"},"license":"AGPL-3.0","_id":"use-inside@0.1.0","maintainers":[{"name":"evalir","email":"hi@enriqueortiz.dev"}],"dist":{"shasum":"f37e47b1b2819cee382df79d990060b8c222d8ed","tarball":"https://registry.npmjs.org/use-inside/-/use-inside-0.1.0.tgz","fileCount":4,"integrity":"sha512-+WFohaTyoXN8Aq60OaFYHuNxejbnVplHZuUVpsjo095kjgykbeqHEl9HcM06V8cbYyMPyGjKdm67H0cCSt7nyQ==","signatures":[{"sig":"MEUCIQDnvUm6nOrFZlGKe1CHuH7/v0mSCiEwsi+uSnW84DUZQgIgU4MjbJREH7nHMD50f+rGCM9637+htWxmJsZEDK+ebYc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWExMCRA9TVsSAnZWagAArDgP/AtwUUP3NLSjPPaLM5mh\nuuIiysfwvLBwVLmoh2vzjWW9vWU/uV5rWrQVGWIlI4WGlkDx4gQnkmIuW4sf\n9CujzAiPDEw5rRJXSr/olx6uT7qtaxpBpWTtFED1wzcO1QLfcZs1K/4D4cqa\nlF4YnQ8oWKD7nqNJf2RT2/rB//PJhtdnp6tBHqI0cBIRlLTnO+SKNOoBR/Vu\nJDB9Ka6vlTivyR8fsLtrVrBTy3z82XvkApmWDmTEa6a/3nJdvHlK/wr9K83U\nKMOKkM1dpSVe+vb9h7p+f5PFNwLp7/oOA0UwsmC46EchQROEe+bCP3MMgPl7\nykr05kfMt8CsrjI96RYxOmBADiQjv7wneADUPN3c9BxLsdSfPWif0sG8/80I\n+jWbBBn5LmGi2v70x6e0iRBVx2ArHRJmWcAUFNyG7FomLebHAlzEO504gkvH\nlX/99XkFCCHfjKbf4+mT+eTOyz2rZj7HJ8yZ1QGJVnWh8H3rX+FgVol3Ws0S\nXI0xZqxXa9gPHYEjxs/icOCjFWrlPFWB0ki5wTDAXlUwY64RNYynG6HErq8Z\nVrLy+0wgzpFvxSDnCDXmqoIrFmm3shP2SrjYSo0zG1HRzN/h75cqL4uI0gGR\nZ3HWk3fmLjJs87cBxu0ncBajACmz8EjJIDWoUykrd9Dg8vSyBAQUng5BtbGI\n+uPP\r\n=j25N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","module":"dist/index.js","gitHead":"c6d12b095ff84955b6c514550bfecc146bc404aa","scripts":{"dev":"yarn rollup --config --watch","lint":"yarn eslint ./src","test":"yarn lint","build":"yarn rollup --config","prepare":"rm -rf ./dist && yarn build","prepublishOnly":"git push && git push --tags"},"_npmUser":{"name":"evalir","email":"hi@enriqueortiz.dev"},"_npmVersion":"6.13.1","description":"[<img src=\"https://img.shields.io/npm/v/use-inside\" alt=\"\" />](https://www.npmjs.com/package/use-inside) [<img src=\"https://img.shields.io/bundlephobia/minzip/use-inside\" alt=\"\" />](https://bundlephobia.com/result?p=use-inside)","directories":{},"sideEffects":false,"_nodeVersion":"13.3.0","dependencies":{"prop-types":"^15.7.2"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","rollup":"^1.29.1","prettier":"^1.19.1","@babel/cli":"^7.8.3","@babel/core":"^7.8.3","babel-eslint":"^10.0.3","builtin-modules":"^3.1.0","@babel/preset-env":"^7.8.3","eslint-plugin-node":"^11.0.0","@babel/preset-react":"^7.8.3","@rollup/plugin-json":"^4.0.1","eslint-plugin-react":"^7.18.0","rollup-plugin-babel":"^4.3.3","eslint-plugin-import":"^2.20.0","rollup-plugin-terser":"^5.2.0","eslint-plugin-promise":"^4.2.1","eslint-config-prettier":"^6.9.0","eslint-config-standard":"^14.1.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-standard":"^4.0.1","@rollup/plugin-commonjs":"^11.0.1","eslint-plugin-react-hooks":"^2.3.0","@rollup/plugin-node-resolve":"^7.0.0","eslint-config-standard-react":"^9.2.0"},"peerDependencies":{"react":"^16.12.0"},"_npmOperationalInternal":{"tmp":"tmp/use-inside_0.1.0_1582845004109_0.22426134900855832","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"use-inside","version":"0.2.0","author":{"name":"Aragon Association","email":"legal@aragon.org"},"license":"MIT","_id":"use-inside@0.2.0","maintainers":[{"name":"ajsantander","email":"palebluedot@gmail.com"},{"name":"aragon-ci","email":"jorge+npmci@aragon.one"},{"name":"bingen","email":"bingen@aragon.one"},{"name":"bpierre","email":"hello@pierre.world"},{"name":"evalir","email":"hi@enriqueortiz.dev"},{"name":"facuspagnuolo","email":"facundo_spagnuolo@icloud.com"},{"name":"gabrielg","email":"gabrielpk.18@gmail.com"},{"name":"izqui","email":"jorge@aragon.one"},{"name":"luisivan","email":"me@luisivan.net"},{"name":"sohkai","email":"qisheng.brett.sun@gmail.com"}],"dist":{"shasum":"cdf7bc3e40495a154d16735584c242aa0f00eb13","tarball":"https://registry.npmjs.org/use-inside/-/use-inside-0.2.0.tgz","fileCount":7,"integrity":"sha512-GYJSslg+NyAeASSwWk1wyc6/Bek/ACIrmuFY/bPbgUjQAVrtVvzjSNiOxNh20e7zanJz/bPxtIQIxq7EzjSPqQ==","signatures":[{"sig":"MEUCIQDi5w7fEm0VzBC2mtv+NHDjsAity2q0exkd2lLgwWvl0wIgReBW7eCFu5pc88oeRFeVppbu2b7gmoQ9bfSFdhV1euU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2/KNCRA9TVsSAnZWagAAj/0P/iQfW19x4L4sl9RTAGGI\nBoFZtkFMQM+eT01+oshgRd2wzTAKeRK9k5za78ZFAgJT0xgOJl3fyRXiVGmb\n8J6f76yj5DMPXUIl/1LAkOukhri1gyJ116FQE9fsZXVjy2/EfGKFc2WFPYeL\nqIjDDnRXFOnB4XLNW2lxmjixwSAWLkk+G6/XUdiCzQ/D25IR7v15fclj7WqS\nDQQMH/5ACvhxFWWYYxARpoG4g0NeMVs6l1qhE+HcdDxqmhB91fI9xxFKuXx1\n7Ltha/j8sVmzAZN43f+wTl6CE8rlLE/XVeQdRqRTN4bXSruJ/83ajcjOrEYy\nmogGMEj7nEGm1dXhjZS4LodmzgLESgE8btMy86q/jO3Em684DSeXVa7g/9n/\nOTdfUCIYxLX+EIadldCdspcWBBNvOnGPkkZ+MW8LyuNjLO353B4+wv21hxcb\nau7RiKk06vanPIVFuWNGSL8rt7vCKDhYNu8c1sQPx1V0nbKjVCBPjdxnpeMw\nyrWuPXLXir/U+xaUJsjCC2OzV/iPPlcx0O09A4LNTys1+DrkCM+9U+qi26hv\nJC8OE3a03ENneZsX8rjetZ8NvESFtAOHdJJ1DiMCgbDojf9j8/G6GK0bnh/k\n2cr2bps0tO1Ag9TTIY6N/O/bKpIGHEaKLAWuVM1QOFdzCzxsRq8Aht2F/3jJ\nRsHy\r\n=gNhS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","module":"dist/index.js","gitHead":"5722cbacb3c3c56f3b6dc968747a76d2c8191e5b","scripts":{"dev":"yarn rollup --config --watch","lint":"yarn eslint ./src","test":"yarn lint","build":"yarn rollup --config","prepare":"rm -rf ./dist && yarn build","prepublishOnly":"git push && git push --tags"},"_npmUser":{"name":"bpierre","email":"hello@pierre.world"},"_npmVersion":"6.13.6","description":"[<img src=\"https://img.shields.io/npm/v/use-inside\" alt=\"\" />](https://www.npmjs.com/package/use-inside) [<img src=\"https://img.shields.io/bundlephobia/minzip/use-inside\" alt=\"\" />](https://bundlephobia.com/result?p=use-inside)","directories":{},"sideEffects":false,"_nodeVersion":"13.7.0","dependencies":{"prop-types":"^15.7.2"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","rollup":"^1.29.1","prettier":"^1.19.1","@babel/cli":"^7.8.3","@babel/core":"^7.8.3","babel-eslint":"^10.0.3","builtin-modules":"^3.1.0","@babel/preset-env":"^7.8.3","eslint-plugin-node":"^11.0.0","@babel/preset-react":"^7.8.3","@rollup/plugin-json":"^4.0.1","eslint-plugin-react":"^7.18.0","rollup-plugin-babel":"^4.3.3","eslint-plugin-import":"^2.20.0","rollup-plugin-terser":"^5.2.0","eslint-plugin-promise":"^4.2.1","eslint-config-prettier":"^6.9.0","eslint-config-standard":"^14.1.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-standard":"^4.0.1","@rollup/plugin-commonjs":"^11.0.1","eslint-plugin-react-hooks":"^2.3.0","@rollup/plugin-node-resolve":"^7.0.0","eslint-config-standard-react":"^9.2.0"},"peerDependencies":{"react":"^16.12.0"},"_npmOperationalInternal":{"tmp":"tmp/use-inside_0.2.0_1585679996301_0.1322196695376101","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-02-27T23:10:04.107Z","modified":"2025-05-09T12:19:36.426Z","0.1.0":"2020-02-27T23:10:04.349Z","0.2.0":"2020-03-31T18:39:56.453Z"},"author":{"name":"Aragon Association","email":"legal@aragon.org"},"license":"MIT","description":"[<img src=\"https://img.shields.io/npm/v/use-inside\" alt=\"\" />](https://www.npmjs.com/package/use-inside) [<img src=\"https://img.shields.io/bundlephobia/minzip/use-inside\" alt=\"\" />](https://bundlephobia.com/result?p=use-inside)","maintainers":[{"email":"devops-master@aragon.org","name":"devops-master"},{"email":"jjavieralvarezrodriguez@gmail.com","name":"jjavieralv"},{"email":"devops@aragon.org","name":"arabot-1"},{"email":"npm@brettsun.com","name":"sohkai"},{"email":"hi@enriqueortiz.dev","name":"evalir"}],"readme":"# 🔬 useInside()\n\n[<img src=\"https://img.shields.io/npm/v/use-inside\" alt=\"\" />](https://www.npmjs.com/package/use-inside) [<img src=\"https://img.shields.io/bundlephobia/minzip/use-inside\" alt=\"\" />](https://bundlephobia.com/result?p=use-inside)\n\nuseInside() allows a component to be aware if its \"inside\" the subtree of another component and receive data from it, in the most straightforward, simple way possible.\n\n## Usage\n\nAdd it to your project:\n\n```console\nyarn add use-inside\n```\n\nUse it in your React app:\n\n```jsx\n// App.js\n\nimport React from 'react'\nimport { Inside, useInside } from 'use-inside'\n\nfunction App() {\n\n  return (\n    <>\n      <h1>useInside</h1>\n      <Inside name=\"papaya\" data={{backgroundColor: 'papayawhip'}}>\n        <Greeting />\n      </Inside>\n    </>\n  )\n}\n\nfunction Greeting() {\n  const [inside, data] = useInside('papaya')\n\n  return <h2 style={{...data}}>{inside && 'papaya'}</h2>\n}\n\nexport default App\n```\n\n## API\n\n### &lt;Inside />\n\nThis is the provider component. It should be placed above any component using `useInside()`. Apart from `children`, it accepts two other props:\n\n#### name (required)\n\nThe name of the inside context. Required for storing the context into a map for later retrieval.\n\n#### data\n\nThe data passed to the component using `useInside()`. Accepts any type.\n\n### useInside()\n\nThis is the hook to be used throughout the app.\n\nIt takes a string as a single required param, and returns an array containing the following:\n\n- `inside`: A `boolean` that will be `true` if the component is in the subtree of the provider\n  `Inside` component.\n- `data`: The data passed through the `Inside` component.\n","readmeFilename":"README.md"}