File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import React , {
2- forwardRef ,
3- useImperativeHandle ,
4- useRef ,
5- useState ,
6- } from "react" ;
1+ import React , { useImperativeHandle , useRef , useState } from "react" ;
72import type { ViewProps } from "react-native" ;
83import { Platform , View } from "react-native" ;
94
@@ -49,10 +44,12 @@ export interface CanvasRef {
4944 getNativeSurface : ( ) => NativeCanvas ;
5045}
5146
52- export const Canvas = forwardRef <
53- CanvasRef ,
54- ViewProps & { transparent ?: boolean }
55- > ( ( { onLayout : _onLayout , transparent, ...props } , ref ) => {
47+ interface CanvasProps extends ViewProps {
48+ transparent ?: boolean ;
49+ ref ?: React . Ref < CanvasRef > ;
50+ }
51+
52+ export const Canvas = ( { transparent, ref, ...props } : CanvasProps ) => {
5653 const viewRef = useRef ( null ) ;
5754 const [ contextId , _ ] = useState ( ( ) => generateContextId ( ) ) ;
5855 useImperativeHandle ( ref , ( ) => ( {
@@ -94,4 +91,4 @@ export const Canvas = forwardRef<
9491 />
9592 </ View >
9693 ) ;
97- } ) ;
94+ } ;
You can’t perform that action at this time.
0 commit comments