Skip to content

Repository files navigation

react-native-save-view

Codacy Badgenpmnpm versionPRs Welcome

Library for saving React Native View/ScrollView elements

Example

exportdefaultclassAppextendsComponent{componentDidMount(){this._saveView();}render(){return(<Viewref={ref=>this._viewRef=ref}collapsable={false}><Text>Some content</Text></View>);}async_saveView(){awaitthis._makeSnapshotPNG();awaitthis._makeSnapshotPNGBase64();}async_makeSnapshotPNG(){awaitRNSaveView.saveToPNG(ref,'/sdcard/Download/view.png');// Check /sdcard/Download/view.png using Device File Explorer}async_makeSnapshotPNGBase64(){constbase64=awaitRNSaveView.saveToPNGBase64(ref);console.log('base64:',base64);}}

Methods

NameAndroidiOSDescription
saveToPNGSave View to PNG file. Before the function is called, check that android has write to file permissions
saveToPNGBase64Save View to PNG base64

License

MIT

Author

Other information

  • Generated with react-native-create-library
  • Zero JavaScript dependency. Which means that you do not bring other dependencies to your project
  • If you think that something is missing or would like to propose new feature, please, discuss it with author
  • Please, feel free to ⭐️ the project. This gives the confidence that you like it and a great job was done by publishing and supporting it 🤩

About

💾 Library for saving React Native View/ScrollView elements

Resources

Contributing

Stars

18 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages