constructor(props) {
super(props);
this.state = {
access_token: '',
};
}
componentDidMount() {
AsyncStorage.getItem('access_token').then(value => {
this.setState({access_token: value});
});
console.log(this.state.access_token);
}
--- internal tick
- componentDidMount
- asyncStorage.getItem
- console.log // на этот момент мы ещё не попали в then
--- internal tick
- then блок
- setState