-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add an onReady callback to the container #8491
Conversation
The Expo app for the example from this branch is ready! expo.io/@react-navigation/react-navigation-example?release-channel=pr-8491 |
|
||
React.useEffect(() => { | ||
onReadyRef.current = onReady; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without useEffect
should be more stable:
const onReadyRef = React.useRef(onReady);
onReadyRef.current = onReady;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not concurrent mode safe. Ref shouldn't be assigned during render.
|
||
React.useImperativeHandle(ref, () => refContainer.current); | ||
|
||
const linkingContext = React.useMemo(() => ({ options: linking }), [linking]); | ||
|
||
if (rest.initialState == null && isLinkingEnabled && !isReady) { | ||
const isReady = rest.initialState != null || !isLinkingEnabled || isResolved; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change to ||
from &&
?
No description provided.