Skip to content

Commit a9c4796

Browse files
committed
fix: remove options from XRButton
1 parent 04efb31 commit a9c4796

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

packages/react/xr/src/deprecated/button.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { ButtonHTMLAttributes, forwardRef, ComponentPropsWithoutRef } from 'reac
22
import { XRStore } from '../xr.js'
33
import { useSessionSupported } from '../hooks.js'
44
import { useStore } from 'zustand'
5-
import { XRSessionInitOptions } from '@pmndrs/xr/internals'
65

76
/**
87
* @deprecated use <button onClick={() => store.enterXR()}> instead
@@ -12,19 +11,14 @@ export const XRButton = forwardRef<
1211
{
1312
store: XRStore
1413
mode: XRSessionMode
15-
options?: XRSessionInitOptions
1614
onError?: (error: any) => void
1715
children?: React.ReactNode | ((status: 'unsupported' | 'exited' | 'entered') => React.ReactNode)
1816
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onError'>
19-
>(({ store, mode, onError, options, children, ...props }, ref) => {
17+
>(({ store, mode, onError, children, ...props }, ref) => {
2018
const session = useStore(store, (xr) => xr.session)
2119
const supported = useSessionSupported(mode, onError)
2220
return (
23-
<button
24-
ref={ref}
25-
{...props}
26-
onClick={() => (session != null ? session.end() : store.enterXR(mode, options).catch(onError))}
27-
>
21+
<button ref={ref} {...props} onClick={() => (session != null ? session.end() : store.enterXR(mode).catch(onError))}>
2822
{typeof children === 'function'
2923
? children(supported ? (session != null ? 'entered' : 'exited') : 'unsupported')
3024
: children}

0 commit comments

Comments
 (0)