Skip to content

Check for null refs#61

Open
RyanCommits wants to merge 1 commit intoslorber:masterfrom
RyanCommits:ryanwang/handle-null-refs
Open

Check for null refs#61
RyanCommits wants to merge 1 commit intoslorber:masterfrom
RyanCommits:ryanwang/handle-null-refs

Conversation

@RyanCommits
Copy link

Issue #60

React will call imperativeHandleEffect with a null ref when this.handleRef is replaced with an anonymous function.

If we replace https://github.com/slorber/react-native-scroll-into-view/blob/master/src/hoc.tsx#L90 with (ref) => this.handleRef(ref), handleRef is called an extra time and ref might be null, and it will crash.

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.

1 participant