Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

remove captured image #48

Open
kimsean opened this issue Apr 14, 2020 · 2 comments
Open

remove captured image #48

kimsean opened this issue Apr 14, 2020 · 2 comments

Comments

@kimsean
Copy link

kimsean commented Apr 14, 2020

Hi. how to removed the captured images? when i capture it and do the process, I navigate it to other page, then when i go back to the camera capture page, the previous image is still there. How do i reset ?

@humphreyja
Copy link
Member

Read through the Capturing an Image section on the readme. The image is NOT deleted from the file system after you navigate away. It is stored in a cache folder, so the OS will clear these eventually. You can manually delete them by deleting the file or the folder which is accessible by import { CACHE_FOLDER_NAME } from 'react-native-rectangle-scanner;

If this is a question of the component not remounting when navigating BACK to the page, this is most likely an issue with your navigation package. Most often, when navigating back to a page, it does not remount the component, or unmount the component when leaving the page. You should turn off and on the camera on navigating to and from the page, rather than just relying on the mount function. (Or you can put the entire camera package in a modal and dismiss the modal after capture. )

@cagv24
Copy link

cagv24 commented Apr 22, 2020

Yeah, @humphreyja is right, the camera has problems with navigation libraries. So it's better to turn off the camera before navigating other pages. What I'm currently doing is using a conditional on a component to display or not the camera component.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants