Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AkilUnik opened this issue Feb 4, 2025 · 0 comments
Open

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

AkilUnik opened this issue Feb 4, 2025 · 0 comments

Comments

@AkilUnik
Copy link

AkilUnik commented Feb 4, 2025

`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",

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

No branches or pull requests

1 participant