question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Capturing two views of different sizes fails randomly (FYI: do not use v2.5 or v2.6)

See original GitHub issue

bug report

Capturing two views of different sizes at or around the same time seems to make one of the resulting images take on the dimensions of the other.

See gif below. There’s an orange square view and a purple square view of different sizes. Pressing each button runs captureRef on the corresponding view and displays the generated img next to it.

Version & Platform

├── react-native@0.59.8
└── react-native-view-shot@2.6.0

Platform: Android

Expected behavior

In this example, running captureRef on the orange square should always produce an image of size 131x132, and running it on the purple square should always produce 262x262.

Actual behavior

Running captureRef on the orange square sometimes uses the purple square’s dimensions, if the purple square has been captured before.

Steps to reproduce the behavior

Clone this repo and run on an Android emulator (or device) to see

git clone https://github.com/m-pol/ReactNativeViewShotBug.git cd ReactNativeViewShotBug npm install react-native run-android

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
EternalChildrencommented, Jun 13, 2019

I think the reason for this problem is cache. it’s always happened in multiple captures. And two description about optimized in README. 1.reusable images, that reduce load on GC; 2.reusable arrays/buffers that also reduce load on GC;

tip: just in Android, ios is great. @gre can you help me?

0reactions
EternalChildrencommented, Jun 14, 2019

@m-pol I have solved it. PR: #222

Read more comments on GitHub >

github_iconTop Results From Across the Web

ISTA 321 - Cross Validation - RPubs
Well, let's make multiple training sets each with a randomly generated set of index values to split with! This way we can make...
Read more >
exam 2 Flashcards | Quizlet
Study with Quizlet and memorize flashcards containing terms like sample selected in such a way that not all samples from the population have...
Read more >
What Are The "TOP 10 DON'T DO'S" of SolidWorks
said in the same thread as Ed's post. Here's my theory on using driven dimensions on the drawing: - I rarely model the...
Read more >
ESP32-CAM Save Picture in Firebase Storage
Set Up Firebase Project for ESP32 and ESP8266 Step 2. 5) It will take a few seconds to set up your project. Then,...
Read more >
How can I get a random record from MongoDB? - Stack Overflow
Starting with the 3.2 release of MongoDB, you can get N random docs from a collection using the $sample aggregation pipeline operator:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found