Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

component rerender for tab navigation

import { useIsFocused } from '@react-navigation/native';

class Home extends React.Component {
  render() {
    // Get it from props
    const { isFocused } = this.props;
  }
}

// Wrap and export
export default function(props) {
  const isFocused = useIsFocused();

  return <Home {...props} isFocused={isFocused} />;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #component #rerender #tab #navigation
ADD COMMENT
Topic
Name
1+1 =