Wie AsyncStorage Artikel bei "componentDidMount" zu bekommen, hier mein CodeAsyncStorage Get Artikel
componentDidMount() {
\t AsyncStorage.getItem('customer_id').then((value)=> this.setState({ customer_id: value }));
console.log(this.state.customer_id); /* doesn't work */
console.log(`${this.state.customer_id}`); /* doesn't work */
}
\t
\t
render() {return <View><Text>Customer ID : {this.state.customer_id}</Text></View>; /* it's work */ }
AsyncStorage ist genau das - async. – Li357
wow, downvote? erstaunliche – Ansyori