JSPM

react-native-snapshot

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q33353F
  • License MIT

Get snapshot images from React Native views as base64 encoded strings.

Package Exports

  • react-native-snapshot

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-snapshot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Take snapshots of React Native views (and their children) and convert it to a base64 encoded string.

Installation

% npm i --save react-native-snapshot

Usage

This library exposes a single method, get. Example usage:

const Snapshot = require('react-native-snapshot');
const ref = React.findNodeHandle(this.refs.someView);

Snapshot.get(ref, (error, content) => {
  if (error) {
    return
  }

  console.log(error)
});

Example

Use cases

  • convert snapshot to base64 encoded string to enable exposing it to a 3rd party service.

TODO