{"bugs":{"url":"https://github.com/drcmda/react-three-fiber/issues"},"dist":{"shasum":"ea85e08adb0cfce7b17702df0fe99b9e93a7b367","tarball":"https://registry.npmjs.org/react-three-fiber/-/react-three-fiber-4.0.21-beta.0.tgz","fileCount":39,"integrity":"sha512-9h6dKm4m2TRfo6x2VfCI0QCGqC61jAOKLwTEp0gpoxMeiI2tC+u2wSob3unEPsOmOb8av5/d+N8TC9MXTAo+gg==","signatures":[{"sig":"MEQCID0uU1racC9FlDEkQ7Xxw1dAo49CwMWMx5fzOrj8F813AiAXX0PZ0sw1qv1YWmlaB+VYm9nNIHBolPAjR2whazNSpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":613841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeb3NyCRA9TVsSAnZWagAAqYMP/jPjW9oGZVry7tUhQLqE\nGYS9bTuogCAQFI+J4BvIi/X7olhACt6YpcU+e6CKsVhNFr6vgnJ+2F90/tIk\ntF1wI0+0MqjmuDd6O7rC9b+nx5CYV6wzj2D/DNK23ja1dkzpd0uj3INnsQ3R\np7uGjXDoIYZtIjgmaLxMmC7WgJlBza4hb6ggUew+GZSRyzwdVhRjP7Uqu1Gr\nMR8OEi+Q8y9H9j7UQK6CdhiByOOybxm5OESJMrxguVTq9QeqsZJI38A+uOt3\nCVPTzjWq0NnY9WozSM2VsFu8d2R6APhG7wit1NzF8oEhngJqXESTa0/Y8Txi\nRjLdL3Wz0zB/pcB2/Sg0afFNOwwv20sUmpumLJt4i43/4OaMP037malAMnEl\n4EJSLOuPpux1SDLt2bOaaSVPo1Kfvt3zSUV3/nG+g1O4ygeG0NDeCGTXiJcd\noONVLBHrn8NtVk/TPWNnd0QgcQXqB2i24EmBAIQg8N2Di2l0kW+e0MjFLmo5\nsU0r2+ZWnlMNtvAt5xTDZWvdptzm3wIaak3coD9xM1NqxVu0ck9+HHT6gUXf\nRKC19HGS138xV+S1cyJA6CgRyHPUgZcunAgB/1QRkffu3qBNSyncJHIalBXL\n+jKHvcfIJtXeHagC/YzX4yam345wdXgFspujY/y15RZQ0AabPdbdjj1L583c\nikWf\r\n=G2Tu\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":"[![Build Status](https://travis-ci.org/react-spring/react-three-fiber.svg?branch=master)](https://travis-ci.org/react-spring/react-three-fiber) [![npm version](https://badge.fury.io/js/react-three-fiber.svg)](https://badge.fury.io/js/react-three-fiber) ![npm](https://img.shields.io/npm/dt/react-three-fiber.svg)\n\n`react-three-fiber` is a React [reconciler](https://github.com/facebook/react/tree/master/packages/react-reconciler) 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 santiy to your codebase. These components react to state changes, are interactive out of the box and can tap into Reacts infitine eco system.\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| | |\n|-|-|\nLet's make a re-usable component that has it's own state, reacts to user-input and participates in the render-loop: | ![https://codesandbox.io/s/rrppl0y8l4](https://i.imgur.com/sS4ArrZ.gif)\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 attach=\"geometry\" args={[1, 1, 1]} />\n      <meshStandardMaterial attach=\"material\" 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[Here's the same](https://codesandbox.io/s/rrppl0y8l4) running in a code sandbox.\n\n#### How to proceed?\n\n1. Before you start, make sure you have a [basic grasp of Threejs](https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene). \n2. When you know what a scene is, a camera, mesh, geometry and material, more or less, fork the [sandbox above](https://github.com/react-spring/react-three-fiber#what-does-it-look-like). \n3. Robert Borghesi's ([@dghez_](https://twitter.com/dghez_)) [Alligator.io tutorial](https://alligator.io/react/react-with-threejs) will lead you through the next steps.\n\nYou can advance your knowledge by reading into [Threejs-fundamentals](https://threejsfundamentals.org) and [Discover Threejs](https://discoverthreejs.com). Looking into the source of the [original threejs-examples](https://threejs.org/examples) couldn't hurt.\n\n# API\n\n## Canvas\n\nThe `Canvas` object is your portal into Threejs. It renders Threejs elements, _not DOM elements_! It stretches to 100% of the next relative/absolute parent-container. Make sure your canvas is given space to show contents!\n\n```jsx\n<Canvas\n  children                      // Either a function child (which receives state) or regular children\n  gl                            // Props that go into the default webGL-renderer\n  camera                        // Props that go into the default camera\n  raycaster                     // Props that go into the default raycaster\n  shadowMap                     // Props that go into gl.shadowMap, can also be set true for PCFsoft\n  sRGB = false                  // Sets encoding to sRGBEncoding, tonemapping to ACESFilmicToneMapping\n  vr = false                    // Switches renderer to VR mode, then uses gl.setAnimationLoop\n  gl2 = false                   // Enables webgl2\n  concurrent = false            // Enables React concurrent mode\n  resize = undefined            // Resize config, see react-use-measure's options\n  orthographic = false          // Creates an orthographic camera if true\n  noEvents = false              // Switch off raytracing and event support\n  pixelRatio = undefined        // You could provide window.devicePixelRatio if you like\n  invalidateFrameloop = false   // When true it only renders on changes, when false it's a game loop\n  updateDefaultCamera = true    // Adjusts default camera on size changes\n  onCreated                     // Callback when vdom is ready (you can block first render via promise)\n  onPointerMissed />            // Response for pointer clicks that have missed a target\n```\n\nYou can give it additional properties like style and className, which will be added to the container (a div) that holds the dom-canvas element.\n\n## Defaults that the canvas component sets up\n\nCanvas will create a _translucent WebGL-renderer_ with the following properties: `antialias, alpha, setClearAlpha(0)`\n\nA default _perspective camera_: `fov: 75, near: 0.1, far: 1000, z: 5, lookAt: [0,0,0]`\n\nA default _orthographic camera_ if Canvas.orthographic is true: `near: 0.1, far: 1000, z: 5, lookAt: [0,0,0]`\n\nA default _shadowMap_ if Canvas.shadowMap is true: `type: PCFSoftShadowMap`\n\nA default _scene_ (into which all the JSX is rendered) and a _raycaster_.\n\nA _wrapping container_ with a [resize observer](https://github.com/react-spring/react-use-measure): `scroll: true, debounce: { scroll: 50, resize: 0 }`\n\nYou do not have to use any of these objects, look under \"Recipes\" down below if you want to bring your own.\n\n## Objects and properties\n\nYou can use [Threejs's entire object catalogue and all properties](https://threejs.org/docs). When in doubt, always consult the docs.\n\nYou could lay out an object like this:\n\n```jsx\n<mesh\n  visible\n  userData={{ test: 'hello' }}\n  position={new THREE.Vector3(1, 2, 3)}\n  rotation={new THREE.Euler(0, 0, 0)}\n  geometry={new THREE.SphereGeometry(1, 16, 16)}\n  material={new THREE.MeshBasicMaterial({ color: new THREE.Color('hotpink'), transparent: true })}\n/>\n```\n\nThe problem is that all of these properties will always be re-created. Instead, you should define properties declaratively.\n\n```jsx\n<mesh visible userData={{ test: 'hello' }} position={[1, 2, 3]} rotation={[0, 0, 0]}>\n  <sphereGeometry attach=\"geometry\" args={[1, 16, 16]} />\n  <meshStandardMaterial attach=\"material\" color=\"hotpink\" transparent />\n</mesh>\n```\n\n#### Shortcuts (set)\n\nAll properties that have a `.set()` method can be given a shortcut. For example [THREE.Color.set](https://threejs.org/docs/index.html#api/en/math/Color.set) can take a color string, hence instead of `color={new THREE.Color('hotpink')}` you can do `color=\"hotpink\"`. Some `set` methods take multiple arguments ([THREE.Vector3.set](https://threejs.org/docs/index.html#api/en/math/Vector3.set)), so you can pass an array `position={[100, 0, 0]}`.\n\n#### Shortcuts and non-Object3D stow-away\n\nStow away non-Object3D primitives (geometries, materials, etc) into the render tree so that they become managed and reactive. They take the same properties they normally would, constructor arguments are passed with `args`. Using the `attach` property objects bind automatically to their parent and are taken off it once they unmount.\n\nYou can nest primitive objects, too:\n\n```jsx\n<meshBasicMaterial attach=\"material\">\n  <texture attach=\"map\" image={img} onUpdate={self => img && (self.needsUpdate = true)} />\n```\n\nSometimes attaching isn't enough. For example, this code attaches effects to an array called \"passes\" of the parent `effectComposer`. Note the use of `attachArray` which adds the object to the target array and takes it out on unmount:\n\n```jsx\n<effectComposer>\n  <renderPass attachArray=\"passes\" scene={scene} camera={camera} />\n  <glitchPass attachArray=\"passes\" renderToScreen />\n```\n\nYou can also attach to named parent properties using `attachObject={[target, name]}`, which adds the object and takes it out on unmount. The following adds a buffer-attribute to parent.attributes.position.\n\n```jsx\n<bufferGeometry attach=\"geometry\">\n  <bufferAttribute attachObject={['attributes', 'position']} count={v.length / 3} array={v} itemSize={3} />\n```\n\n#### Piercing into nested properties\n\nIf you want to reach into nested attributes (for instance: `mesh.rotation.x`), just use dash-case:\n\n```jsx\n<mesh rotation-x={1} material-uniforms-resolution-value={[1 / size.width, 1 / size.height]} />\n```\n\n#### Putting already existing objects into the scene-graph\n\nYou can use the `primitive` placeholder for that. You can still give it properties or attach nodes to it. Never add the same object multiples times, this is not allowed in Threejs!\n\n```jsx\nconst mesh = new THREE.Mesh()\nreturn <primitive object={mesh} position={[0, 0, 0]} />\n```\n\n#### Using 3rd-party (non THREE namespaced) objects in the scene-graph\n\nThe `extend` function extends three-fibers catalogue of known native JSX elements.\n\n```jsx\nimport { extend } from 'react-three-fiber'\nimport { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer'\nimport { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass'\nextend({ EffectComposer, RenderPass })\n\n<effectComposer>\n  <renderPass />\n```\n\n## Automatic disposal\n\nFreeing resources is a [manual chore in Threejs](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects), but react is aware of object-lifecycles, hence three-fiber will attempt to free resources for you by calling `object.dispose()` (if present) on all unmounted objects.\n\nIf you manage assets by yourself, globally or in a cache, this may *not* be what you want. You can recursively switch it off:\n\n```jsx\nconst globalGeometry = new THREE.BoxBufferGeometry()\nconst globalMaterial = new THREE.MeshBasicMatrial()\n\nfunction Mesh() {\n  return <mesh geometry={globalGeometry} material={globalMaterial} dispose={null} />\n```\n\n## Events\n\nThreejs objects that implement their own `raycast` method (meshes, lines, etc) can be interacted with by declaring events on the object. We support pointer events ([you need to polyfill them yourself](https://github.com/jquery/PEP)), clicks and wheel-scroll. Events contain the browser event as well as the Threejs event data (object, point, distance, etc).\n\nAdditionally there's a special `onUpdate` that is called every time the object gets fresh props, which is good for things like `self => (self.verticesNeedUpdate = true)`.\n\n```jsx\n<mesh\n  onClick={e => console.log('click')}\n  onWheel={e => console.log('wheel spins')}\n  onPointerUp={e => console.log('up')}\n  onPointerDown={e => console.log('down')}\n  onPointerOver={e => console.log('over')}\n  onPointerOut={e => console.log('out')}\n  onPointerEnter={e => console.log('enter')}\n  onPointerLeave={e => console.log('leave')}\n  onPointerMove={e => console.log('move')}\n  onUpdate={self => console.log('props have been updated')}\n/>\n```\n\n#### Event data\n\n```jsx\n({\n  ...DomEvent                   // All the original event data\n  ...ThreeEvent                 // All of Three's intersection data\n  object: Object3D              // The object that was actually hit\n  eventObject: Object3D         // The object that registered the event\n  unprojectedPoint: Vector3     // Camera-unprojected point\n  ray: Ray                      // The ray that was used to strike the object\n  camera: Camera                // The camera that was used in the raycaster\n  sourceEvent: DomEvent         // A reference to the host event\n  delta: number                 // Initial-click delta\n}) => ...\n```\n\n#### Propagation and capturing\n\n```jsx\n  onPointerDown={e => {\n    // Only the mesh closest to the camera will be processed\n    e.stopPropagation()\n    // You may optionally capture the target\n    e.target.setPointerCapture(e.pointerId)\n  }}\n  onPointerUp={e => {\n    e.stopPropagation()\n    // Optionally release capture\n    e.target.releasePointerCapture(e.pointerId)\n  }}\n```\n\n## Hooks\n\nHooks can only be used **inside** the Canvas element because they rely on context! You cannot expect something like this to work:\n\n```jsx\nfunction App() {\n  const { size } = useThree() // This will just crash\n  return (\n    <Canvas>\n      <mesh>\n```\n\nDo this instead:\n\n```jsx\nfunction SomeComponent() {\n  const { size } = useThree()\n  return <mesh />\n}\n\nfunction App() {\n  return (\n    <Canvas>\n      <SomeComponent />\n```\n\n#### useThree(): SharedCanvasContext\n\nThis hooks gives you access to all the basic objects that are kept internally, like the default renderer, scene, camera. It also gives you the current size of the canvas in screen and viewport coordinates. The hook is reactive, if you resize the browser, for instance, and you get fresh measurements, same applies to any of the defaults you can change.\n\n```jsx\nimport { useThree } from 'react-three-fiber'\n\nconst {\n  gl,                           // WebGL renderer\n  scene,                        // Default scene\n  camera,                       // Default camera\n  size,                         // Bounds of the view (which stretches 100% and auto-adjusts)\n  viewport,                     // Bounds of the viewport in 3d units + factor (size/viewport)\n  aspect,                       // Aspect ratio (size.width / size.height)\n  mouse,                        // Current 2D mouse coordinates\n  clock,                        // THREE.Clock (useful for useFrame deltas)\n  invalidate,                   // Invalidates a single frame (for <Canvas invalidateFrameloop />)\n  intersect,                    // Calls onMouseMove handlers for objects underneath the cursor\n  setDefaultCamera,             // Sets the default camera\n} = useThree()\n```\n\n#### useFrame(callback: (state, delta) => void, renderPriority: number = 0)\n\nThis hooks calls you back every frame, which is good for running effects, updating controls, etc. You receive the state (same as useThree) and a clock delta. If you supply a render priority greater than zero it will switch off automatic rendering entirely, you can then control rendering yourself. If you have multiple frames with a render priority then they are ordered highest priority last, similar to the web's z-index. Frames are managed, three-fiber will remove them automatically when the component that holds them is unmounted.\n\nUpdating controls:\n\n```jsx\nimport { useFrame } from 'react-three-fiber'\n\nconst controls = useRef()\nuseFrame(state => controls.current.update())\nreturn <orbitControls ref={controls} />\n```\n\nTaking over the render-loop:\n\n```jsx\nuseFrame(({ gl, scene, camera }) => gl.render(scene, camera), 1)\n```\n\n#### useResource(optionalRef=undefined)\n\nWhen you want to share and re-use resources. `useResource` creates a ref and re-renders the component when it becomes available next frame.\n\n```jsx\nimport { useResource } from 'react-three-fiber'\n\nconst [ref, material] = useResource()\nreturn (\n  <meshBasicMaterial ref={ref} />\n  {material && (\n    <mesh material={material} />\n    <mesh material={material} />\n    <mesh material={material} />\n```\n\n#### useUpdate(callback, dependencies, optionalRef=undefined)\n\nWhen objects need to be updated imperatively.\n\n```jsx\nimport { useUpdate } from 'react-three-fiber'\n\nconst ref = useUpdate(\n  geometry => {\n    geometry.addAttribute('position', getVertices(x, y, z))\n    geometry.attributes.position.needsUpdate = true\n  },\n  [x, y, z] // execute only if these properties change\n)\nreturn <bufferGeometry ref={ref} />\n```\n\n#### useLoader(loader, url: string | string[], extensions?) (experimental!)\n\nThis hooks loads assets and suspends for easier fallback- and error-handling. If you need to lay out GLTF's declaratively check out [gltfjsx](https://github.com/react-spring/gltfjsx).\n\n```jsx\nimport React, { Suspense } from 'react'\nimport { useLoader } from 'react-three-fiber'\nimport { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'\n\nfunction Asset({ url }) {\n  const gltf = useLoader(GLTFLoader, url)\n  return <primitive object={gltf.scene} dispose={null} />\n}\n\n<Suspense fallback={<Cube />}>\n  <Asset url=\"/spaceship.gltf\" />\n</Suspense>\n```\n\nYou can provide a callback if you need to configure your loader:\n\n```jsx\nimport { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader'\n\nuseLoader(GLTFLoader, url, loader => {\n  const dracoLoader = new DRACOLoader()\n  dracoLoader.setDecoderPath('/draco-gltf/')\n  loader.setDRACOLoader(dracoLoader)\n})\n```\n\nIt can also make multiple requests in parallel:\n\n```jsx\nconst [bumpMap, specMap, normalMap] = useLoader(TextureLoader, [url1, url2, url2])\n```\n\n#### useCamera(camera, props) (experimental!)\n\nThis is a special purpose hook for the rare case when you are using non-default cameras for heads-up-displays or portals, and you need events/raytracing to function properly (raycasting uses the default camera otherwise).\n\n```jsx\nimport { useCamera } from 'react-three-fiber'\n\n<mesh raycast={useCamera(customCamera)} onPointerMove={e => console.log('move')}>\n```\n\n## Additional exports\n\n```jsx\nimport {\n  addEffect,                    // Adds a global callback which is called each frame\n  addTail,                      // Adds a global callback which is called when rendering stops\n  invalidate,                   // Forces view global invalidation\n  extend,                       // Extends the native-object catalogue\n  createPortal,                 // Creates a portal (it's a React feature for re-parenting)\n  render,                       // Internal: Renders three jsx into a scene\n  unmountComponentAtNode,       // Internal: Unmounts root scene\n  applyProps,                   // Internal: Sets element properties\n  Dom,                          // Project HTML content\n} from 'react-three-fiber'\n```\n\n#### Dom (experimental, web-only!)\n\nSometimes you want to project dom-content on top (or underneath) of the canvas. The experimental `Dom` component behaves like an empty `THREE.Group` internally, you can transform and nest it inside the canvas. It's children on the other hand will be rendered into a div element and projected to the groups whereabouts.\n\n```jsx\n<Dom\n  children                      // Regular dom content, text, images, divs, etc\n  prepend = false               // Will be projected in front of the canvas\n  center = false                // Adds a -50%/-50% css transform\n  style                         // Regular css styles, will be added to the inner div container\n  className                     // ..\n  onClick                       // ..\n  ... />\n```\n\n```jsx\nimport { Canvas, Dom } from 'react-three-fiber'\n\n<Canvas>\n  <Dom position={[100, 0, 100]}>\n    <h1>hello world!</h1>\n  </Dom>\n</Canvas>\n```\n\n# Links\n\nNews and examples via Twitter: [@0xca0a](https://twitter.com/0xca0a)\n\nRecipes and FAQ: [/react-three-fiber/recipes.md](recipes.md)\n\nGLTF-to-JSX converter: https://github.com/react-spring/gltfjsx\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:\n\nBTC: 36fuguTPxGCNnYZSRdgdh6Ea94brCAjMbH\n\nETH: 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.9.0","description":"React-fiber renderer for THREE.js","directories":{},"maintainers":[{"name":"drcmda","email":"drcmda@gmail.com"}],"sideEffects":false,"_nodeVersion":"12.0.0","contributors":[{"name":"Birkir Gudjonsson","email":"birkir.gudjonsson@gmail.com"}],"dependencies":{"scheduler":"0.19.0","tiny-emitter":"^2.1.0","utility-types":"^3.10.0","@babel/runtime":"^7.8.7","react-merge-refs":"^1.0.0","react-reconciler":"0.25.0","react-use-measure":"^2.0.0","react-promise-suspense":"^0.3.2","@juggle/resize-observer":"^3.1.1","resize-observer-polyfill":"^1.5.1"},"react-native":"native.js","_hasShrinkwrap":false,"readmeFilename":"readme.md","peerDependencies":{"react":">=16.13","three":">=0.114","react-dom":">=16.13"},"_npmOperationalInternal":{"tmp":"tmp/react-three-fiber_4.0.21-beta.0_1584362353768_0.4386398351330205","host":"s3://npm-registry-packages"},"_id":"react-three-fiber@4.0.21-beta.0","version":"4.0.21-beta.0"}