Skip to content

Conversation

@therealpurplemana
Copy link

What

Wraps the Skia Canvas with a View component to provide better layout control and flexibility. The View handles layout events and styles, while the Canvas receives explicit width/height dimensions.

This fix is a backwards compatible patch for the post Skia 2.20 removal of canvas.onLayout.

Changes

  • Added View import from react-native to wrap the Skia Canvas component
  • Moved onLayout and style props to the outer View wrapper
  • Applied explicit width and height styles to the SkiaProxy.Canvas based on layout measurements
  • Merged user-provided styles with { flex: 1 } to maintain backwards compatibility
  • Canvas now receives dimensions from parent View instead of handling layout directly

Tested on

  • Expo 53 + React 19 + Skia 2.3.10 (with no memory leak on iOS!)

Related issues


🤖 Generated with Claude Code

Wraps the Skia Canvas with a View component to provide better layout control and flexibility. The View handles layout events and styles, while the Canvas receives explicit width/height dimensions.

This fix is a backwards compatible patch for the post Skia 2.20 removal of canvas.onLayout.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Nov 13, 2025

@therealpurplemana is attempting to deploy a commit to the mrousavy's Team Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 react-native-skia removed support for onLayout in v2.2.1

1 participant