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

persist event to avoid event.nativeEvent null in setState #13

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@slorber
Copy link
Contributor

slorber commented Feb 11, 2019

This fixes TypeError: null is not an object (evaluating 'e.nativeEvent.layout') in case setState is called after event has been put back in event pool. React does not guarantee you can read event attributes in a setState with update fn.

persist event
This fixes `TypeError: null is not an object (evaluating 'e.nativeEvent.layout')` in case setState is called after event has been put back in event pool. React does not guarantee you can read event attributes in a setState with update fn.

@slorber slorber referenced this pull request Feb 11, 2019

Closed

Slows down iphoneX #10

@browniefed

This comment has been minimized.

Copy link
Owner

browniefed commented Feb 11, 2019

Instead of persist can you please save off the height outside of the set state then reference that.

Persisting events is not really encouraged

@browniefed

This comment has been minimized.

Copy link
Owner

browniefed commented Feb 11, 2019

Thanks for digging into the issue I do not use this library anymore so any maintenance helps

slorber added a commit to slorber/react-native-ticker that referenced this pull request Feb 11, 2019

@slorber slorber referenced this pull request Feb 11, 2019

Merged

fix event pooling issue #14

@slorber

This comment has been minimized.

Copy link
Contributor Author

slorber commented Feb 11, 2019

np, I use it in only one app so will report anything strange encountered

@slorber slorber closed this Feb 11, 2019

browniefed added a commit that referenced this pull request Feb 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.