react-native-view-shot

Snapshot a React Native view and save it to an image

MIT License

Downloads
731.1K
Stars
2.7K
Committers
80

Bot releases are visible (Hide)

react-native-view-shot - Latest Release

Published by gre about 1 year ago

react-native-view-shot -

Published by gre over 1 year ago

  • fix ViewShotProperties.style type (#473) thanks @WazzeZ @tum-more
  • Simplify Android background thread (#472) thanks @msafutin
  • Add type for useRenderInContext (#475) thanks @chmac
  • Feature: Add web support (#476) thanks @chrispader
react-native-view-shot -

Published by gre about 2 years ago

  • Support capture SurfaceView on Android (#427) thanks @jhen0409 and @CAMOBAP
  • fix referenced react-native-cameraroll link error (#436) thanks @rxliuli
  • add fileName typing to Capture options (#423) thanks @steo-ml
  • Update index.d.ts (#419) thanks @dancixx
  • Fixes #291: Android: width/height options are absolute dimensions (#414)
  • Android target API level 30 – fixes #373 (#415)
react-native-view-shot -

Published by gre over 2 years ago

Maintenance release supporting latest version of iOS / Android and react native.

Fixes

  • Fix android build to support latest React Native – thanks @cristianocca
  • Fix ios configuration: enable build in Xcode 12 (for iOS >= 12) (#338) thanks @LeoValentim
  • Fixes captureScreen on iOS. (#407) thanks @ashfurrow
  • Fix typescript(View): onLayout (#380) thanks @comanzanares

Features

  • Android: snapshot in background (#317) thanks @gdoudeng
  • Android: add custom file name props (#318) thanks @LkyYuen
  • Added UI dispatcher usage in the Windows implementation (#376) thanks @qmatteoq
  • iOS: Add option to use renderInContext method to eliminate issue with blank captures for large views (#350) thanks @Crhaj
react-native-view-shot -

Published by gre about 5 years ago

  • Fixes <ViewShot> that was recently broken. (props captureMode check)
  • better error checks and errors cases. (e.g. when module is not properly configured or when you pass an deferenced ref)
react-native-view-shot -

Published by gre about 5 years ago

  • Fix next props call
react-native-view-shot -

Published by gre about 5 years ago

  • Fixes compile error in metro package
  • fix the bug that deposit the wrong bitmap to buffer
react-native-view-shot -

Published by gre about 5 years ago

  • Add React.Ref support to captureRef
  • fixed bug with child views transformation loss
  • fixes flowtype and typescript defs
react-native-view-shot -

Published by gre about 5 years ago

  • Improve Java implementation (code quality)
  • fixed the base64 MIME type when JPG is chosen
  • introduced RAW image format and ZIP-base64 result packaging algorithm
  • Android perf improvments
react-native-view-shot -

Published by gre about 5 years ago

  • Fix positioning of TextureView elements relative to target element
react-native-view-shot -

Published by gre about 5 years ago

  • Adding style props to main container of ViewShot
react-native-view-shot -

Published by gre about 5 years ago

  • add .ts typedef
  • make onCapture & onCaptureFailure props optional in flow type
  • Add check for null path in releaseCapture
react-native-view-shot -

Published by gre about 5 years ago

  • Include RCTUIManagerUtils.h for more recent RN versions
react-native-view-shot -

Published by gre about 5 years ago

  • fixes
  • documentation
  • improve example
react-native-view-shot -

Published by gre about 7 years ago

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:

react-native-view-shot -

Published by gre over 7 years ago

fix Android build

react-native-view-shot -

Published by gre over 7 years ago

react-native-view-shot -

Published by gre over 7 years ago

react-native-view-shot -

Published by gre about 8 years ago

https://github.com/gre/react-native-view-shot/pull/8 [Android] Fixes the extension of the image

react-native-view-shot -

Published by gre about 8 years ago

  • 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 https://github.com/gre/react-native-view-shot/pull/3
Package Rankings
Top 0.91% on Npmjs.org
Related Projects