Comments (2)
While this.setState
is typically very very fast, it's still an async method. It has an optional second argument which is a function that is called after the state is set. Try logging your state like so:
componentDidMount: function() {
var self = this;
UIImagePickerManager.showImagePicker({title: 'select...'}, function (type, response) {
console.log(self.state.imageSource);
self.setState({imageSource: {uri: response}}, () => {
console.log(self.state.imageSource);
});
});
}
You should see the correct logging with that. Also, try using the imageSource in an <Image>
in your render method and you'll see the picture!
from react-native-image-picker.
😂 My mistake...
@marcshilling You are right. Thank you very much.
from react-native-image-picker.
Related Issues (20)
- [🐛]Uploaded file size is bigger than original size HOT 3
- [🐛] On the ios platform, the video may be rotated, causing the width and height values of the video to be obtained incorrectly.
- [🐛] The latest version does not support ios .mov format videos
- [🐛] launchCamera doesn't work on targetSdkVersion 33 HOT 3
- [🐛] Navigating to react navigation modal after image picker often causes navigation to break HOT 3
- [🐛] Duplicate Cached Files On Android - Gallery Selection HOT 2
- [🐛] even the camera is not lauching and showing properties lauch camera undefined or null HOT 1
- App restarting after clicking okay [🐛]
- App restarting after clicking okay [🐛] HOT 3
- [🐛] The project cannot be started after importing this library.
- [🐛] Picking MOV videos has a significant delay on iOS HOT 4
- [🐛] I used includeBase64: true but still not getting the value of base64
- [🐛] iOS returning path to empty image HOT 1
- [🐛] Android with newArch enabled fails with `assemble` option
- [🐛] couldn't find meta-data for provider with authority image pickerprovider HOT 2
- after selected the image, captureAudio(mic) automatically enabled. how to disble that
- [🌟] ITMS-91053 (Apple Required Reasons APIs): Declare an approved Required Reason for `NSPrivacyAccessedAPIType` HOT 11
- ':react-native-image-picker:compileDebugJavaWithJavac'[🐛] HOT 2
- [🐛] "TypeError: Cannot read property 'launchImageLibrary' of null" on Android. HOT 3
- [🐛] Error: react-native-image-picker: NativeModule.ImagePickerManager is null.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-image-picker.