Skip to content

Commit

Permalink
fix "useXRInputSourceStateContext can only be used ..." for XRTransie…
Browse files Browse the repository at this point in the history
…ntPointers, XRGazes, and XRScreenInputs
  • Loading branch information
bbohlender committed Nov 10, 2024
1 parent feb2a37 commit 3a75921
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/react/xr/src/elements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ function XRTransientPointers() {
return null
}
return (
<XRSpace key={objectToKey(state)} space="target-ray-space">
<xrInputSourceStateContext.Provider value={state}>
<xrInputSourceStateContext.Provider value={state}>
<XRSpace key={objectToKey(state)} space="target-ray-space">
<Suspense>
{typeof ResolvedImpl === 'function' ? (
<ResolvedImpl />
) : (
<DefaultXRTransientPointer {...ResolvedImpl} />
)}
</Suspense>
</xrInputSourceStateContext.Provider>
</XRSpace>
</XRSpace>
</xrInputSourceStateContext.Provider>
)
})}
</>
Expand All @@ -152,17 +152,17 @@ function XRGazes() {
<>
{gazeStates.map((state) => {
return (
<XRSpace key={objectToKey(state)} space="target-ray-space">
<xrInputSourceStateContext.Provider value={state}>
<xrInputSourceStateContext.Provider value={state}>
<XRSpace key={objectToKey(state)} space="target-ray-space">
<Suspense>
{typeof Implementation === 'function' ? (
<Implementation />
) : (
<DefaultXRGaze {...spreadable(Implementation)} />
)}
</Suspense>
</xrInputSourceStateContext.Provider>
</XRSpace>
</XRSpace>
</xrInputSourceStateContext.Provider>
)
})}
</>
Expand All @@ -179,17 +179,17 @@ function XRScreenInputs() {
<>
{screenInputStates.map((state) => {
return (
<XRSpace key={objectToKey(state)} space="target-ray-space">
<xrInputSourceStateContext.Provider value={state}>
<xrInputSourceStateContext.Provider value={state}>
<XRSpace key={objectToKey(state)} space="target-ray-space">
<Suspense>
{typeof Implementation === 'function' ? (
<Implementation />
) : (
<DefaultXRScreenInput {...spreadable(Implementation)} />
)}
</Suspense>
</xrInputSourceStateContext.Provider>
</XRSpace>
</XRSpace>
</xrInputSourceStateContext.Provider>
)
})}
</>
Expand Down

0 comments on commit 3a75921

Please sign in to comment.