Skip to content

Commit

Permalink
Use useLayoutEffect for better transition
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarzagonel authored Oct 9, 2023
1 parent ad8eb0f commit f37b466
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion versioned_docs/version-6.x/header-buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function StackScreen() {
function HomeScreen({ navigation }) {
const [count, setCount] = React.useState(0);

React.useEffect(() => {
React.useLayoutEffect(() => {
// Use `setOptions` to update the button that we previously specified
// Now the button includes an `onPress` handler to update the count
navigation.setOptions({
Expand Down

0 comments on commit f37b466

Please sign in to comment.