Невозможно добавить состояние AsyncStorage в redux-persist. Как правильно перенести данные из AsyncStorage в redux-persist?
class Main extends React.Component {
constructor(props) {
super(props);
this.state= {
user: {},
visible: true
};
}
componentDidMount() {
this._loadInitialState().done();
}
_loadInitialState = async () => {
await AsyncStorage.getItem('user', (err, sData) => {
if ( err == null ) {
this.setState({
user: JSON.parse( sData )
})
}
});
}
render() {
return (
<View style={{ marginLeft: 30 }}>
<Text style={{ fontSize: 22, color: "#4A2481" }}>{this.state.user.firstname + ' ' + this.state.user.lastname}</Text>
<Text style={{ fontSize: 17, color: "#EA329A" }}>{this.state.user.positionName}</Text>
<Text style={{ fontSize: 17, color: "#EA329A" }}>{this.state.user.tabNumber}</Text>
</View>
</View>
}
}
Какой правильный редуктор и действие должны быть?