Skip to content

Commit

Permalink
fix: state management flow to avoid data loss
Browse files Browse the repository at this point in the history
  • Loading branch information
pasyukevich committed Jul 24, 2023
1 parent d4fc53c commit 69a49b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/withOnyx.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function (mapOnyxToState) {
return;
}

this.setState({...this.tempState, loading: false});
this.setState(prevState => ({...this.tempState, ...prevState, loading: false}));
delete this.tempState;
}

Expand Down

0 comments on commit 69a49b0

Please sign in to comment.