diff --git a/packages/fiber/src/native/Canvas.tsx b/packages/fiber/src/native/Canvas.tsx index 81a6d35c7f..db14e5034b 100644 --- a/packages/fiber/src/native/Canvas.tsx +++ b/packages/fiber/src/native/Canvas.tsx @@ -66,6 +66,8 @@ const CanvasImpl = /*#__PURE__*/ React.forwardRef( const viewRef = React.useRef(null!) const root = React.useRef>(null!) + const [antialias, setAntialias] = React.useState(true) + const onLayout = React.useCallback((e: LayoutChangeEvent) => { const { width, height, x, y } = e.nativeEvent.layout setSize({ width, height, top: y, left: x }) @@ -81,7 +83,10 @@ const CanvasImpl = /*#__PURE__*/ React.forwardRef( addEventListener: (() => {}) as any, removeEventListener: (() => {}) as any, clientHeight: context.drawingBufferHeight, - getContext: (() => context) as any, + getContext: ((_: any, { antialias = false }) => { + setAntialias(antialias) + return context + }) as any, } as HTMLCanvasElement root.current = createRoot(canvasShim) @@ -141,7 +146,9 @@ const CanvasImpl = /*#__PURE__*/ React.forwardRef( return ( - {width > 0 && } + {width > 0 && ( + + )} ) },