Set it via the setOptions to avoid it being defined in the Navigator component, far from its context where it can be forgotten
EDIT: Actually, for fixed titles, it could be defined and exported as a constant from the component file and then imported and set in the navigator. This would prevent using a useEffect to set it dynamically while it can be configured statically.
The main point of this ticket is to colocate the title with its screen component rather than far away.
The setOptions will continue to be used for dynamic titles.
Set it via the
setOptionsto avoid it being defined in the Navigator component, far from its context where it can be forgottenEDIT: Actually, for fixed titles, it could be defined and exported as a constant from the component file and then imported and set in the navigator. This would prevent using a useEffect to set it dynamically while it can be configured statically.
The main point of this ticket is to colocate the title with its screen component rather than far away.
The
setOptionswill continue to be used for dynamic titles.