File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import React, {
44 useEffect ,
55 useCallback ,
66 useImperativeHandle ,
7- forwardRef ,
87} from "react" ;
98import type { LayoutChangeEvent } from "react-native" ;
109
@@ -239,10 +238,12 @@ export interface SkiaPictureViewHandle {
239238 ) : void ;
240239}
241240
242- export const SkiaPictureView = forwardRef <
243- SkiaPictureViewHandle ,
244- SkiaPictureViewNativeProps
245- > ( ( props , ref ) => {
241+ export interface SkiaPictureViewProps extends SkiaPictureViewNativeProps {
242+ ref ?: React . Ref < SkiaPictureViewHandle > ;
243+ }
244+
245+ export const SkiaPictureView = ( props : SkiaPictureViewProps ) => {
246+ const { ref } = props ;
246247 const canvasRef = useRef < HTMLCanvasElement | null > ( null ) ;
247248 const renderer = useRef < Renderer | null > ( null ) ;
248249 const redrawRequestsRef = useRef ( 0 ) ;
@@ -415,10 +416,10 @@ export const SkiaPictureView = forwardRef<
415416 }
416417 } , [ picture , redraw ] ) ;
417418
418- const { debug = false , ...viewProps } = props ;
419+ const { debug = false , ref : _ref , ...viewProps } = props ;
419420 return (
420421 < Platform . View { ...viewProps } onLayout = { onLayoutEvent } >
421422 < canvas ref = { canvasRef } style = { { display : "flex" , flex : 1 } } />
422423 </ Platform . View >
423424 ) ;
424- } ) ;
425+ } ;
You can’t perform that action at this time.
0 commit comments