Skip to content

Releases: gre/react-native-view-shot

v2.3.0

10 Aug 03:52
@gre gre
Compare
Choose a tag to compare
  • Adding style props to main container of ViewShot

v2.2.0

10 Aug 03:51
@gre gre
Compare
Choose a tag to compare
  • add .ts typedef
  • make onCapture & onCaptureFailure props optional in flow type
  • Add check for null path in releaseCapture

v2.1.1

10 Aug 03:51
@gre gre
Compare
Choose a tag to compare
  • Include RCTUIManagerUtils.h for more recent RN versions

v2.1.0

10 Aug 03:50
@gre gre
Compare
Choose a tag to compare
  • fixes
  • documentation
  • improve example

v2.0.0

25 Aug 19:54
@gre gre
Compare
Choose a tag to compare

New ViewShot component, drop deprecated options, rename APIs

  • ViewShot is a React Component that you can use to snapshot anything, it is now the recommended way to use the library. It have different usages for different usecases, refer the README.

The simplest way to use it:

<ViewShot captureMode="mount" onCapture={uri => console.log("do something with ", uri)}>
  ...something to capture
</ViewShot>

ViewShot renders a View to wrap the children, this allows to hide complexity of using the library for Android (for some components you need to have a wrapping View collapsable={false} for the lib to work. Using ViewShot, you no longer have to worry about this)

But you can still use the library with the imperative API:

  • takeSnapshot(viewRef, options) function was renamed to captureRef(viewRef, options)
  • releaseCapture(uri) is a new function that accept an uri created with takeSnapshot and remove the tmpfile

Options changes

  • the result option "file" was renamed to "tmpfile"
  • the format option "jpeg" is dropped, simply use "jpg" (there used to be both supported)
  • the path option is no longer supported, see section below

Dropped path option and dirs constants

A feature used to allow to set an arbitrary file path. This has become tricky to maintain because all the edge cases and use-cases of file management so we have decided to drop it, making this library focusing more on solving snapshotting and not file system.

To migrate from this old feature, you have a few solutions:

v1.10.1

29 Jun 12:57
@gre gre
Compare
Choose a tag to compare

fix Android build

v1.10.0

28 Jun 14:24
@gre gre
Compare
Choose a tag to compare
  • iOS: use RCTGetUIManagerQueue #72
  • iOS: added a cocoapod file #55
  • Android: Save the picture to the album to broadcast the album refresh #73

v1.9.0

11 Mar 12:31
@gre gre
Compare
Choose a tag to compare
  • Windows support added #45
  • improve error messages of the iOS implementation
  • implement snapshotContentContainer support on iOS too

v1.1.1

08 Sep 15:00
@gre gre
Compare
Choose a tag to compare

#8 [Android] Fixes the extension of the image

v1.1.0

26 Aug 08:26
@gre gre
Compare
Choose a tag to compare
  • Introduce result to specify the output format (save to a file / yield a base64)
  • make Android version rejecting the promise instead of throwing native exception (like in iOS implementation)
  • optim' the Android to not cache view forever #3