Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Commit

Permalink
fix: workaround UI not updating on layout change
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Nov 17, 2019
1 parent d368c93 commit 47747cf
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/TabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,19 @@ export default class TabBar<T extends Route> extends React.Component<
return;
}

this.setState({
layout: {
height,
width,
},
});
// If we don't delay this state update, the UI gets stuck in weird state
// Maybe an issue in Reanimated?
// https://github.com/react-native-community/react-native-tab-view/issues/877
requestAnimationFrame(() =>
requestAnimationFrame(() =>
this.setState({
layout: {
height,
width,
},
})
)
);
};

private getTranslateX = memoize(
Expand Down

0 comments on commit 47747cf

Please sign in to comment.