Skip to content
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

Merged
merged 1 commit into from
Jun 22, 2020
Merged

Conversation

satya164
Copy link
Member

No description provided.

@github-actions
Copy link

The Expo app for the example from this branch is ready!

expo.io/@react-navigation/react-navigation-example?release-channel=pr-8491

@satya164 satya164 merged commit 8177c45 into main Jun 22, 2020
@satya164 satya164 deleted the @satya164/on-ready branch June 22, 2020 12:03

React.useEffect(() => {
onReadyRef.current = onReady;
});

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;

Copy link
Member Author

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;
Copy link

@JDMathew JDMathew Dec 23, 2020

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 && ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants