Skip to content

Commit c3297c2

Browse files
committed
chore(dev): fix TS issues
1 parent fdd5e8a commit c3297c2

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

package/src/hooks/useConfigureAssetShadow.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function useConfigureAssetShadow({ renderableManager, asset, receiveShado
2020
const { workletContext } = useFilamentContext()
2121

2222
const renderableEntities = useMemo(() => asset?.getRenderableEntities(), [asset])
23-
const prevCastShadowRef = useRef<boolean>()
23+
const prevCastShadowRef = useRef<boolean | null>(null)
2424
useEffect(() => {
2525
if (renderableEntities == null || castShadow == null || prevCastShadowRef.current === castShadow) {
2626
return
@@ -36,7 +36,7 @@ export function useConfigureAssetShadow({ renderableManager, asset, receiveShado
3636
})
3737
}, [castShadow, renderableManager, renderableEntities, workletContext])
3838

39-
const prevReceiveShadowRef = useRef<boolean>()
39+
const prevReceiveShadowRef = useRef<boolean | null>(null)
4040
useEffect(() => {
4141
if (renderableEntities == null || receiveShadow == null || prevReceiveShadowRef.current === receiveShadow) {
4242
return

package/src/hooks/usePrevious.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useEffect, useRef } from 'react'
44
* A hook that returns the previous value of a variable
55
*/
66
export default function usePrevious<T>(value: T): T | undefined {
7-
const ref = useRef<T>()
7+
const ref = useRef<T | undefined>(undefined)
88
useEffect(() => {
99
ref.current = value
1010
}, [value])

package/src/native/specs/FilamentViewNativeComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { HostComponent, ViewProps, codegenNativeComponent } from 'react-native'
1+
import { codegenNativeComponent, type HostComponent, type ViewProps } from 'react-native'
22
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes'
33

44
export interface NativeProps extends ViewProps {

package/src/react/FilamentView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ let viewIds = 0
3232
* The component that actually renders the native view and displays our content (think of it as canvas).
3333
*/
3434
export class FilamentView extends React.PureComponent<FilamentProps> {
35-
private readonly ref: React.RefObject<RefType>
35+
private readonly ref: React.RefObject<RefType | null>
3636
private surfaceCreatedListener: Listener | undefined
3737
private surfaceDestroyedListener: Listener | undefined
3838
private renderCallbackListener: Listener | undefined

package/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
"strict": true,
2525
"target": "esnext"
2626
},
27-
"exclude": ["node_modules"]
27+
"exclude": ["node_modules", "lib"]
2828
}

0 commit comments

Comments
 (0)