Last active
March 3, 2020 10:11
-
-
Save kirandash/f24ddbf17735a9b3378b65bf882e8bec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Track API calls in network for React Native Application | |
// Add the below code to App.js file: | |
XMLHttpRequest = GLOBAL.originalXMLHttpRequest ? | |
GLOBAL.originalXMLHttpRequest : GLOBAL.XMLHttpRequest; | |
// 2. React Native Vertically aligning Content | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center' | |
} | |
// 3. onChangeText event not working for TextInput | |
// It happens bcoz event handler function for onChangeText is asynchronous, hence you should use async/await | |
<TextInput | |
onChangeText={text => this.onChange(text)} | |
/> | |
onChange = async (text) => { | |
await this.setState({ | |
listingId: text | |
}) | |
} | |
// 4. Clear xcode simulator cache | |
xcrun simctl erase all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment