Skip to content

add: useTabFocusEffect hook. #95

@adebola-io

Description

@adebola-io

Add an effect hook to be called from anywhere in a subtree that tracks the active and inactive state of the parent tab context. This is similar to the useStackViewFocusEffect previously implemented.

It will accept a callback that is run when the tab becomes active, and returns another callback to be run when it is "blurred" (becomes inactive)

useTabFocusEffect(() => {
  console.log('Tab is active')
  
  return () => {
    console.log('Tab is inactive')
  }
}) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions