{"bugs":{"url":"https://github.com/drcmda/react-three-fiber/issues"},"dist":{"shasum":"697e2beabc3e2c106e797399728a33611bebeb41","tarball":"https://registry.npmjs.org/react-three-fiber/-/react-three-fiber-5.0.0-beta.2.tgz","fileCount":38,"integrity":"sha512-lfqjdyngYVfmaI2nBVeAuYweQ29lQzOYEKF6Ej/naG8gAg+Rkv4uziDwcY3QftproXXBz45k4JCm7qrQ3YbyCQ==","signatures":[{"sig":"MEUCIQDtcA7wpU9uhvPn65IbLauPHq2lstIgwW4/+kS+9BDAWQIgDuLjWqlIgC+ZXMye9fWjpWNNjVQYQxT1iYBu6CNtvLg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":624558,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezjBdCRA9TVsSAnZWagAAax0QAJNSQzAiL76lGyfGjsFT\nZtyTRUaFG2+0Nsa8hk3ti2lJHxOuNkLrM2yu0tYKLnvBMqmiVJhPGe1U07f/\n+K65hcbc7/e6all9NX4XsoPX+SkTFj1VTk3XbI/1mwQSOLMNAUCJM56yjh4X\nfnjn24+xf3GkxQxP9VCW4vxqP7+Nu4Fs1vvB7bVsaTx8WaF32UOOpgnGvzSE\nX1HklsgbVJ6PvdZlscRvm0VkHTwB1K5g3Kz3lyCpngSJ/37GTXl6R69sRAw9\nyK9Y0zAp/6bhHhjoiDKO2LRPa0s+NuAyYnIKggdl8zmFwVjs4Cn/Qt63zX4H\n7RmJTfYjlyKWazyJrFumBs7y8NOJGdfk7MzLNgN89ax71d4dxTt+YPnz+e0j\n478Ndhc+TcWpONWd8o+/SF/QzFZHAomqkhJvS/wK2ArLEjsMszlkvUxLbK2s\nKrSGaPgFW22624OJonY0k95yvQNh9Wl/iIas+ncCCpDfYqpBTuWXtlYW/B1O\nn2K8vB2zA7zCRrSdLuyEnpCJNXXGCQ4QZPsR79Ma+W3TIQlFuUn5WLb296Tx\niX5zGvSbe2p7ayvtKlet2mqcpEltcWqFDfIqhlWb5xepdoW7jOLpUm4fodZd\nweU9f5cZFsHnSg6G3drKwlFTAjuFMru+ayg2RtrEayVAivGVp1wxloOIRWaN\nchtN\r\n=dPKl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"web.cjs.js","name":"react-three-fiber","types":"targets/web.d.ts","author":{"name":"Paul Henschel"},"module":"web.js","readme":"<h1>react-three-fiber</h1>\n\n<a href=\"https://travis-ci.org/react-spring/react-three-fiber\"><img src=\"https://travis-ci.org/react-spring/react-three-fiber.svg?branch=master\" alt=\"Build Status\"></a>\n<a href=\"https://badge.fury.io/js/react-three-fiber\"><img src=\"https://badge.fury.io/js/react-three-fiber.svg\" alt=\"npm version\"></a>\n<img src=\"https://img.shields.io/npm/dt/react-three-fiber.svg\" alt=\"npm download\">\n\nreact-three-fiber is a React <a href=\"https://github.com/facebook/react/tree/master/packages/react-reconciler\">reconciler</a> for Threejs on the web and react-native.\n\n<br />\n\n    npm install three react-three-fiber\n\n<br />\n<p align=\"center\">\n  <a href=\"https://codesandbox.io/embed/r3f-game-i2160\"><img width=\"288\" src=\"https://i.imgur.com/VydCh6W.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-gamma-correction-kmb9i\"><img width=\"288\" src=\"https://i.imgur.com/e6NhRz6.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-montage-jz9l97qn89\"><img width=\"288\" src=\"https://i.imgur.com/nxRStP8.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-sparks-sbf2i\"><img width=\"288\" src=\"https://i.imgur.com/Fk44Tu6.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-instanced-colors-8fo01\"><img width=\"288\" src=\"https://i.imgur.com/daJIDVE.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-moksha-f1ixt\"><img width=\"288\" src=\"https://i.imgur.com/ltznOJ1.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-bones-3i7iu\"><img width=\"288\" src=\"https://i.imgur.com/OZdSyQy.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-floating-diamonds-prb9t\"><img width=\"288\" src=\"https://i.imgur.com/WWDbcWG.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-volumetric-light-w633u\"><img width=\"288\" src=\"https://i.imgur.com/7E3XKSG.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-particles-ii-pjcc1\"><img width=\"288\" src=\"https://i.imgur.com/QG14IAC.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-gltf-fonts-c671i\"><img width=\"288\" src=\"https://i.imgur.com/SHPhIls.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-cannon-physics-nr84m\"><img width=\"288\" src=\"https://i.imgur.com/M9rupWP.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/wonderful-chandrasekhar-8l9rrj36j0\"><img width=\"288\" src=\"https://i.imgur.com/HSTGdcO.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-train-l900i\"><img width=\"288\" src=\"https://i.imgur.com/B3AzZVH.gif\" /></a>\n  <a href=\"https://codesandbox.io/embed/r3f-particles-i-q4d2v\"><img width=\"288\" src=\"https://i.imgur.com/XscsWgu.gif\" /></a>\n</p>\n<p align=\"middle\">\n  <i>These demos are real, you can click them! They contain the full code, too.</i>\n</p>\n\n#### Why?\n\nBuilding dynamic scene graphs declaratively with re-usable components makes dealing with Threejs easier and brings order and sanity to your codebase. These components react to state changes, are interactive out of the box and can tap into React's infinite ecosystem.\n\n#### Does it have limitations?\n\nNone. Everything that works in Threejs will work here. In contrast to \"bindings\" where a library ships/maintains dozens of wrapper components, it just reconciles JSX to Threejs dynamically: `<mesh />` simply is another expression for `new THREE.Mesh()`. It does not know or target a specific Threejs version nor does it need updates for modified, added or removed upstream features.\n\n#### Is it slower than raw Threejs?\n\nNo. Rendering performance is up to Threejs and the GPU. Components may participate in the renderloop outside of React, without any additional overhead. React is otherwise very efficient in building and managing component-trees, it could potentially outperform manual/imperative apps at scale.\n\n#### What does it look like?\n\n<table>\n  <tr>\n    <td>Let's make a re-usable component that has its own state, reacts to user-input and participates in the render-loop. (<a href=\"https://codesandbox.io/s/rrppl0y8l4\">live demo</a>).</td>\n    <td>\n      <a href=\"https://codesandbox.io/s/rrppl0y8l4\">\n        <img src=\"https://i.imgur.com/sS4ArrZ.gif\" /></td>\n      </a>\n  </tr>\n</table>\n\n```jsx\nimport ReactDOM from 'react-dom'\nimport React, { useRef, useState } from 'react'\nimport { Canvas, useFrame } from 'react-three-fiber'\n\nfunction Box(props) {\n  // This reference will give us direct access to the mesh\n  const mesh = useRef()\n\n  // Set up state for the hovered and active state\n  const [hovered, setHover] = useState(false)\n  const [active, setActive] = useState(false)\n\n  // Rotate mesh every frame, this is outside of React without overhead\n  useFrame(() => (mesh.current.rotation.x = mesh.current.rotation.y += 0.01))\n\n  return (\n    <mesh\n      {...props}\n      ref={mesh}\n      scale={active ? [1.5, 1.5, 1.5] : [1, 1, 1]}\n      onClick={(e) => setActive(!active)}\n      onPointerOver={(e) => setHover(true)}\n      onPointerOut={(e) => setHover(false)}>\n      <boxBufferGeometry args={[1, 1, 1]} />\n      <meshStandardMaterial color={hovered ? 'hotpink' : 'orange'} />\n    </mesh>\n  )\n}\n\nReactDOM.render(\n  <Canvas>\n    <ambientLight />\n    <pointLight position={[10, 10, 10]} />\n    <Box position={[-1.2, 0, 0]} />\n    <Box position={[1.2, 0, 0]} />\n  </Canvas>,\n  document.getElementById('root')\n)\n```\n\n---\n\n# API\n\n- [api.md](api.md)\n- [pitfalls.md](pitfalls.md)\n- [recipes.md](recipes.md)\n\n# Eco system\n\n- 🌭 [drei](https://github.com/react-spring/drei), useful helpers for react-three-fiber\n- 💣 [use-cannon](https://github.com/react-spring/use-cannon), physics based hooks\n- 🤳 [react-xr](https://github.com/react-spring/react-xr), VR/AR controllers and events\n- 🎮 [gltfjsx](https://github.com/react-spring/gltfjsx), turns GLTFs into JSX components\n- 🐻 [zustand](https://github.com/react-spring/zustand), state management\n- ✌️ [react-spring](https://github.com/react-spring/react-spring), a spring-physics-based animation library\n- 👇 [react-use-gesture](https://github.com/react-spring/react-use-gesture), mouse/touch gestures\n- 🧪 [react-three-gui](https://github.com/ueno-llc/react-three-gui), GUI/debug tools\n\n# News, updates, community\n\n- [@0xca0a](https://twitter.com/0xca0a)'s twitter\n- [github discussions](https://github.com/react-spring/react-three-fiber/discussions)\n\n# How to contribute\n\nIf you like this project, please consider helping out. All contributions are welcome as well as donations to [Opencollective](https://opencollective.com/react-three-fiber), or in crypto `BTC: 36fuguTPxGCNnYZSRdgdh6Ea94brCAjMbH`, `ETH: 0x6E3f79Ea1d0dcedeb33D3fC6c34d2B1f156F2682`.\n\n#### Sponsors\n\n<a href=\"https://opencollective.com/react-three-fiber/sponsor/0/website\" target=\"_blank\">\n  <img src=\"https://opencollective.com/react-three-fiber/sponsor/0/avatar.svg\"/>\n</a>\n<a href=\"https://opencollective.com/react-three-fiber/sponsor/1/website\" target=\"_blank\">\n  <img src=\"https://opencollective.com/react-three-fiber/sponsor/1/avatar.svg\"/>\n</a>\n\n#### Backers\n\nThank you to all our backers! 🙏\n\n<a href=\"https://opencollective.com/react-three-fiber#backers\" target=\"_blank\">\n  <img src=\"https://opencollective.com/react-three-fiber/backers.svg?width=890\"/>\n</a>\n\n##### Contributors\n\nThis project exists thanks to all the people who contribute.\n\n<a href=\"https://github.com/react-spring/react-three-fiber/graphs/contributors\">\n  <img src=\"https://opencollective.com/react-three-fiber/contributors.svg?width=890\" />\n</a>\n","license":"MIT","private":false,"_npmUser":{"name":"drcmda","email":"drcmda@gmail.com"},"homepage":"https://github.com/drcmda/react-three-fiber#readme","keywords":["react","renderer","fiber","three","threejs"],"collective":{"url":"https://opencollective.com/react-three-fiber","type":"opencollective"},"repository":{"url":"git+https://github.com/drcmda/react-three-fiber.git","type":"git"},"_npmVersion":"6.14.4","description":"React-fiber renderer for THREE.js","directories":{},"maintainers":[{"name":"drcmda","email":"drcmda@gmail.com"}],"sideEffects":false,"_nodeVersion":"14.2.0","contributors":[{"name":"Birkir Gudjonsson","email":"birkir.gudjonsson@gmail.com"}],"dependencies":{"scheduler":"0.19.1","tiny-emitter":"^2.1.0","utility-types":"^3.10.0","@babel/runtime":"^7.9.6","react-merge-refs":"^1.0.0","react-reconciler":"0.25.1","react-use-measure":"^2.0.0","react-promise-suspense":"^0.3.3","@juggle/resize-observer":"^3.1.3","resize-observer-polyfill":"^1.5.1"},"react-native":"native.js","_hasShrinkwrap":false,"readmeFilename":"readme.md","peerDependencies":{"react":">=16.13","three":">=0.116","react-dom":">=16.13"},"_npmOperationalInternal":{"tmp":"tmp/react-three-fiber_5.0.0-beta.2_1590571101070_0.20219861091484237","host":"s3://npm-registry-packages"},"_id":"react-three-fiber@5.0.0-beta.2","version":"5.0.0-beta.2"}