Auto scale image height with React Native

Try this: import React, { Component, PropTypes } from “react”; import { Image } from “react-native”; export default class ScaledImage extends Component { constructor(props) { super(props); this.state = { source: { uri: this.props.uri } }; } componentWillMount() { Image.getSize(this.props.uri, (width, height) => { if (this.props.width && !this.props.height) { this.setState({ width: this.props.width, height: height * (this.props.width … Read more

React navigation goBack() and update parent state

You can pass a callback function as parameter when you call navigate like this: const DEMO_TOKEN = await AsyncStorage.getItem(‘id_token’); if (DEMO_TOKEN === null) { this.props.navigation.navigate(‘Login’, { onGoBack: () => this.refresh(), }); return -3; } else { this.doSomething(); } And define your callback function: refresh() { this.doSomething(); } Then in the login/registration view, before goBack, you … Read more

Renaming a React Native project?

You can change the name attribute in package.json, run react-native upgrade, and just let react overwrite the android/ios files. Don’t overwrite your index files if there is unsaved code, however. Then change your Appregistry line from AppRegistry.registerComponent(‘MyAppIOS’, () => MyAppIOS); To: AppRegistry.registerComponent(‘MyApp’, () => MyApp);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)