Skip to content

Commit

Permalink
Fix onChangeStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
nnnnoel committed Oct 2, 2021
1 parent 834dd0a commit 115a4db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-swipe-up-panel",
"version": "1.2.17",
"version": "1.2.18",
"description": "Swipeable bottom panel for react native",
"author": "Enes Ozturk",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/Panel.tsx
Expand Up @@ -230,8 +230,6 @@ class SwipeablePanel extends React.Component<
this.setState({
showComponent: true,
status: newStatus,
}, () => {
this.props.onChangeStatus?.(this.state.status);
});

Animated.spring(this.state.pan, {
Expand All @@ -242,6 +240,8 @@ class SwipeablePanel extends React.Component<
restDisplacementThreshold: 10,
restSpeedThreshold: 10,
}).start(() => {
this.props.onChangeStatus?.(newStatus);

if (newStatus === 0) {
if (this.props.onClose) this.props.onClose();
this.setState({
Expand Down

0 comments on commit 115a4db

Please sign in to comment.