Skip to content

Commit

Permalink
docs: fixed some ts issues in the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
saitonakamura committed Mar 23, 2023
1 parent cb0f0ca commit fe828cc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions examples/src/demos/HitTest.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Box } from '@react-three/drei'
import { Canvas } from '@react-three/fiber'
import { Controllers, useHitTest, ARButton, XR } from '@react-three/xr'
import React from 'react'
import * as THREE from 'three'
import React, { ComponentProps } from 'react'
import { type Mesh } from 'three'

export function HitTestExample(props: JSX.IntrinsicElements['mesh']) {
const boxRef = React.useRef<THREE.Mesh>(null)
export function HitTestExample(props: ComponentProps<typeof Box>) {
const boxRef = React.useRef<Mesh>(null)

useHitTest((hitMatrix) => {
if (boxRef.current) {
Expand All @@ -19,7 +19,7 @@ export function HitTestExample(props: JSX.IntrinsicElements['mesh']) {
export default function () {
return (
<>
<ARButton onError={(e) => console.error(e)} />
<ARButton />
<Canvas>
<XR>
<ambientLight intensity={0.5} />
Expand Down
6 changes: 3 additions & 3 deletions examples/src/demos/Interactive.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Box } from '@react-three/drei'
import { Canvas } from '@react-three/fiber'
import { Controllers, Interactive, VRButton, XR } from '@react-three/xr'
import React from 'react'
import React, { ComponentProps } from 'react'

export function Button(props: JSX.IntrinsicElements['mesh']) {
export function Button(props: ComponentProps<typeof Box>) {
const [hover, setHover] = React.useState(false)
const [color, setColor] = React.useState(0x123456)

Expand All @@ -19,7 +19,7 @@ export function Button(props: JSX.IntrinsicElements['mesh']) {
export default function () {
return (
<>
<VRButton onError={(e) => console.error(e)} />
<VRButton />
<Canvas>
<XR>
<ambientLight intensity={0.5} />
Expand Down
2 changes: 1 addition & 1 deletion examples/src/demos/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function PlayerExample() {
export default function () {
return (
<>
<VRButton onError={(e) => console.error(e)} />
<VRButton />
<Canvas>
<XR>
<ambientLight intensity={0.5} />
Expand Down
5 changes: 3 additions & 2 deletions examples/src/demos/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Box, Text } from '@react-three/drei'
import { Canvas } from '@react-three/fiber'
import { Controllers, VRButton, XR } from '@react-three/xr'
import { ComponentProps } from 'react'

export function BoxText(props: JSX.IntrinsicElements['mesh']) {
export function BoxText(props: ComponentProps<typeof Box>) {
return (
<Box {...props} args={[0.4, 0.1, 0.1]}>
<meshStandardMaterial color={0x0000ff} />
Expand All @@ -16,7 +17,7 @@ export function BoxText(props: JSX.IntrinsicElements['mesh']) {
export default function () {
return (
<>
<VRButton onError={(e) => console.error(e)} />
<VRButton />
<Canvas>
<XR>
<ambientLight intensity={0.5} />
Expand Down

0 comments on commit fe828cc

Please sign in to comment.