Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-save-view

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-save-view

React native save View implementation

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
58K
increased by32.35%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-save-view

Codacy Badge npm npm version PRs Welcome

Library for saving React Native View/ScrollView elements

Example

export default class App extends Component {
  componentDidMount() {
    this._saveView();
  }

  render() {
    return (
      <View ref={ref => this._viewRef = ref} collapsable={false}>
        <Text>Some content</Text>
      </View>
    );
  }

  async _saveView() {
    await this._makeSnapshotPNG();
    await this._makeSnapshotPNGBase64();
  }

  async _makeSnapshotPNG() {
    await RNSaveView.saveToPNG(ref, '/sdcard/Download/view.png');
    // Check /sdcard/Download/view.png using Device File Explorer
  }

  async _makeSnapshotPNGBase64() {
    const base64 = await RNSaveView.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

  • rumax

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 🤩

Keywords

FAQs

Package last updated on 15 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc