You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a breaking change in the API for capturing canvas snapshots between @shopify/react-native-skia versions 1.90 and 1.10.1. The makeImageFromView function used in v1.90 no longer works in v1.10.1, and needs to be replaced with viewRef.current.makeImageSnapshot().
This causes runtime errors for applications that upgrade from v1.90 to v1.10.1 without updating their code.
Current Behavior
In version 1.90:
const snapshot = await makeImageFromView(viewRef);
works correctly.
In version 1.10.1:
The above code throws the following error:
Error: Argument appears to not be a ReactComponent. Keys: makeImageSnapshot,makeImageSnapshotAsync,redraw,getNativeId
Must use viewRef.current.makeImageSnapshot() instead
React Native Skia Version
1.10.1
React Native Version
0.76.6
Using New Architecture
Enabled
Steps to Reproduce
Create a React Native project with @shopify/react-native-skia v1.90
Implement canvas snapshot functionality using makeImageFromView
Upgrade @shopify/react-native-skia to version 1.10.1
Try to capture canvas snapshot
Snack, Code Example, Screenshot, or Link to Repository
// Working in v1.90
import { makeImageFromView } from '@shopify/react-native-skia';
const getSignature = async () => {
const snapshot = await makeImageFromView(viewRef);
const imageData = snapshot.encodeToBase64();
};
Description
There's a breaking change in the API for capturing canvas snapshots between @shopify/react-native-skia versions 1.90 and 1.10.1. The makeImageFromView function used in v1.90 no longer works in v1.10.1, and needs to be replaced with viewRef.current.makeImageSnapshot().
This causes runtime errors for applications that upgrade from v1.90 to v1.10.1 without updating their code.
Current Behavior
In version 1.90:
const snapshot = await makeImageFromView(viewRef);
works correctly.
In version 1.10.1:
The above code throws the following error:
Error: Argument appears to not be a ReactComponent. Keys: makeImageSnapshot,makeImageSnapshotAsync,redraw,getNativeId
React Native Skia Version
1.10.1
React Native Version
0.76.6
Using New Architecture
Steps to Reproduce
Create a React Native project with @shopify/react-native-skia v1.90
Implement canvas snapshot functionality using makeImageFromView
Upgrade @shopify/react-native-skia to version 1.10.1
Try to capture canvas snapshot
Snack, Code Example, Screenshot, or Link to Repository
// Working in v1.90
import { makeImageFromView } from '@shopify/react-native-skia';
const getSignature = async () => {
const snapshot = await makeImageFromView(viewRef);
const imageData = snapshot.encodeToBase64();
};
// Required for v1.10.1
const getSignature = async () => {
const snapshot = await viewRef.current.makeImageSnapshot();
const imageData = snapshot.encodeToBase64();
};
The text was updated successfully, but these errors were encountered: