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

[Navigator] Pass route into onItemRef #1154

Closed
wants to merge 1 commit into from
Closed

Conversation

ide
Copy link
Contributor

@ide ide commented May 5, 2015

The index alone isn't so useful; pass the route as well. (I am using this to implement componentWill/DidFocus in a library instead of onWill/DidFocus; #1153).

Test Plan: Set up a navigator with a couple of scenes, and see that when onItemRef is called for each one, the route is passed in as the third argument.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 5, 2015
The index alone isn't so useful; pass the route as well. (I am using this to implement componentWill/DidFocus in a library instead of onWill/DidFocus).

Test Plan: Set up a navigator with a couple of scenes, and see that when onItemRef is called for each one, the route is passed in as the third argument.
@ericvicenti
Copy link
Contributor

This looks really useful. I'll start merging it in. I'm curious to see how your library works!

vjeux pushed a commit to vjeux/react-native that referenced this pull request May 13, 2015
Summary:
The index alone isn't so useful; pass the route as well. (I am using this to implement componentWill/DidFocus in a library instead of onWill/DidFocus; facebook#1153).

Closes facebook#1154
Github Author: James Ide <ide@jameside.com>

@public

Test Plan:  Set up a navigator with a couple of scenes, and see that when onItemRef is called for each one, the route is passed in as the third argument.
@ide ide closed this in 6a69930 May 13, 2015
@ide ide deleted the nav-ref-route branch May 13, 2015 22:45
mganandraj pushed a commit to mganandraj/react-native that referenced this pull request May 13, 2022
Remove setting an extra index as it is a substitution attack vulnerab…
facebook-github-bot pushed a commit that referenced this pull request Jul 25, 2022
…ion for type-punning (#1154)

Summary:
C++ does not, pedantically, allow the use of unions for type-punning in the way that C does. Most compilers, in practice, do support it; however, recent versions of MSVC appear to have a bug that cause bad code to be generated due to this U.B. (see: https://developercommunity.visualstudio.com/t/Bad-code-generated-for-std::isnan-compil/10082631). This led to a series of issues in the react-native-windows project, see:
* microsoft/react-native-windows#4122
* microsoft/react-native-windows#8675

In C++20, the `<bit>` header and `bit_cast` function provide a pleasant API for type-punning. Since C++20 is not universally available, if the feature-test macro for `bit_cast` is not defined, memcpy is used instead.

X-link: facebook/yoga#1154

Reviewed By: Andrey-Mishanin

Differential Revision: D38082048

Pulled By: rozele

fbshipit-source-id: a5da08cfb7d4296c725fb44871c55dbb12dc71e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants