terrylinla / react-native-sketch-canvas

A React Native component for drawing by touching on both iOS and Android.
MIT License
695 stars 453 forks source link

image not saving #178

Closed yafetHamouda closed 4 years ago

yafetHamouda commented 4 years ago
const saveImage = () => {
    console.log('saved');
    imageRef.current.save({
      includeImage: true,
      cropToImageSize: true,
      imageType: 'jpg',
    });
  };
<SketchCanvas
              localSourceImage={{filename: imageString}}
              ref={imageRef}
              style={{flex: 1}}
              strokeColor={'red'}
              strokeWidth={3}
              onSketchSaved={(success, path) => {
                console.log('here');
                console.log('success is', success);
                console.log('path is', path);
                }}>
</SketchCanvas>
<Button title="save" onPress={saveImage} />

Nothing happens when clicking saveImage and onSketchSaved doesn't get executed.

YASH6004 commented 2 years ago

any updates?