Skip to content

[Error: Failed to snapshot view tag 440] #561

Open
@AkilUnik

Description

@AkilUnik

`import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import React from 'react';
import {RFValue} from 'react-native-responsive-fontsize';
import {captureRef} from 'react-native-view-shot';

const SettingScreen = () => {
const imageRef = React.useRef(null);

const onSaveImageAsync = async () => {
try {
const localUri = await captureRef(imageRef, {
height: 440,
quality: 1,
});

  // await MediaLibrary.saveToLibraryAsync(localUri);
  // if (localUri) {
  //   alert('Saved!');
  // }
} catch (e) {
  console.log(e);
}

};

return (
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>

<Image
source={{uri: 'https://i.pravatar.cc/300'}}
style={{
height: 200,
width: 200,
borderRadius: 100,
resizeMode: 'cover',
}}
/>

  <TouchableOpacity
    style={{marginTop: RFValue(100)}}
    onPress={onSaveImageAsync}>
    <Text>Save</Text>
  </TouchableOpacity>
</View>

);
};

export default SettingScreen;

const styles = StyleSheet.create({});
`

its not working i also add collapsable={false} but it seems to be broke

version ==> "react-native-view-shot": "^4.0.3",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions