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.3
npm -v: 5.0.3
yarn --version (if you use Yarn): 0.27.5
Then, specify:
- Development Operating System: macOS
- Build tools: Xcode 9 beta 3
Steps to Reproduce
- create a react native app with a
ScollView
- open the app in Xcode 9
- scroll the scroll view
- observe the runtime issues of Xcode 9
Expected Behavior
No runtime issues should occur.
Actual Behavior
The scrollView property of RCTScrollEvent is accessed, but not on the main thread:

Reproducible Demo
https://github.com/HeEAaD/Demo-ReactNative-UI-not-on-main-thread
yarn install
- 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.
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
ScollViewExpected Behavior
No runtime issues should occur.
Actual Behavior
The

scrollViewproperty ofRCTScrollEventis accessed, but not on the main thread:Reproducible Demo
https://github.com/HeEAaD/Demo-ReactNative-UI-not-on-main-thread
yarn installReactNativeUINotOnMainThread.xcodeprojwith Xcode 9ReactNativeUINotOnMainThreadPossible fix
RCTEventDispatchercalls-[RCTScrollEvent body]on a background thread. Therefore this method should not access its scroll view. We can initializeRCTScrollEventwith contentOffset, contentInset, contentSize, frame and zoomScale of the scroll view rather then the scroll view itself.