You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open ReactNativeUINotOnMainThread.xcodeproj with Xcode 9
run scheme ReactNativeUINotOnMainThread
wait until the app is launched in the simulator
scroll a bit in the app
observe the runtime issues in Xcode
Possible fix
RCTEventDispatcher calls -[RCTScrollEvent body] on a background thread. Therefore this method should not access its scroll view. We can initialize RCTScrollEvent with contentOffset, contentInset, contentSize, frame and zoomScale of the scroll view rather then the scroll view itself.
The text was updated successfully, but these errors were encountered:
Is this a bug report?
Yes
Have you read the Bugs section of the Contributing to React Native Guide?
Yes
Environment
react-native -v
: 1000.0.0 (current master, 6dd9d16)node -v
: v8.1.3npm -v
: 5.0.3yarn --version
(if you use Yarn): 0.27.5Then, specify:
Steps to Reproduce
ScollView
Expected Behavior
No runtime issues should occur.
Actual Behavior
The
scrollView
property ofRCTScrollEvent
is accessed, but not on the main thread:Reproducible Demo
https://github.com/HeEAaD/Demo-ReactNative-UI-not-on-main-thread
yarn install
ReactNativeUINotOnMainThread.xcodeproj
with Xcode 9ReactNativeUINotOnMainThread
Possible fix
RCTEventDispatcher
calls-[RCTScrollEvent body]
on a background thread. Therefore this method should not access its scroll view. We can initializeRCTScrollEvent
with contentOffset, contentInset, contentSize, frame and zoomScale of the scroll view rather then the scroll view itself.The text was updated successfully, but these errors were encountered: