Summary:
After we imported Fabric surface presenter observer mechanism, the thread-safe issue comes up, `operations` may read-write on main thread and shadow queue.
```
2019-03-20 15:53:21.249742+0800 RNTester[36039:1402802] *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSArrayM: 0x60000396a730> was mutated while being enumerated.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001083221bb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000106a07735 objc_exception_throw + 48
2 CoreFoundation 0x000000010831ee9c __NSFastEnumerationMutationHandler + 124
3 RNTester 0x00000001048c8784 -[RCTNativeAnimatedModule didMountComponentsWithRootTag:] + 596
4 RNTester 0x000000010491423e -[RCTSurfacePresenter mountingManager:didMountComponentsWithRootTag:] + 1662
5 RNTester 0x00000001048f54e9 -[RCTMountingManager _performMountItems:rootTag:] + 1369
6 RNTester 0x00000001048f4eba __62-[RCTMountingManager performTransactionWithMutations:rootTag:]_block_invoke + 58
7 RNTester 0x0000000104710d1d __RCTExecuteOnMainQueue_block_invoke + 29
8 libdispatch.dylib 0x000000010a4db595 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x000000010a4dc602 _dispatch_client_callout + 8
10 libdispatch.dylib 0x000000010a4e999a _dispatch_main_queue_callback_4CF + 1541
11 CoreFoundation 0x00000001082873e9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
12 CoreFoundation 0x0000000108281a76 __CFRunLoopRun + 2342
13 CoreFoundation 0x0000000108280e11 CFRunLoopRunSpecific + 625
14 GraphicsServices 0x000000010e0c11dd GSEventRunModal + 62
15 UIKitCore 0x000000011567281d UIApplicationMain + 140
16 RNTester 0x0000000104553380 main + 112
17 libdyld.dylib 0x000000010a552575 start + 1
)
```
[iOS] [Fixed] - Fixed native animated crash because of thread-safe issue
Pull Request resolved: https://github.com/facebook/react-native/pull/24063
Differential Revision: D14563994
Pulled By: shergin
fbshipit-source-id: 98970c8993b7b794273ed3a8c40dbbce147e1f4b
React Native
Learn once, write anywhere:
Build mobile apps with React.
Getting Started · Learn the Basics · Showcase · Contribute · Community · Support
React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.
- Declarative. React makes it painless to create interactive UIs. Declarative views make your code more predictable and easier to debug.
- Component-Based. Build encapsulated components that manage their own state, then compose them to make complex UIs.
- Developer Velocity. See local changes in seconds. Changes to JavaScript code can be live reloaded without rebuilding the native app.
- Portability. Reuse code across iOS, Android, and other platforms.
Contents
- Requirements
- Building your first React Native app
- Documentation
- Upgrading
- How to Contribute
- Code of Conduct
- License
📋 Requirements
React Native apps may target iOS 9.0 and Android 4.1 (API 16) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like Expo can be used to work around this.
🎉 Building your first React Native app
Follow the Getting Started guide. The recommended way to install React Native depends on your project. Here you can find short guides for the most common scenarios:
📖 Documentation
The full documentation for React Native can be found on our website.
The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the React documentation.
The source for the React Native documentation and website is hosted on a separate repo, @facebook/react-native-website.
🚀 Upgrading
Upgrading to new versions of React Native may give you access to more APIs, views, developer tools and other goodies. See the Upgrading Guide for instructions.
React Native releases are discussed in the React Native Community, @react-native-community/react-native-releases.
👏 How to Contribute
The main purpose of this repository is to continue evolving React Native core. We want to make contributing to this project as easy and transparent as possible, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving React Native.
Code of Conduct
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
Contributing Guide
Read our Contributing Guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to React Native.
Open Source Roadmap
You can learn more about our vision for React Native in the Roadmap.
Good First Issues
We have a list of good first issues that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.
Discussions
Larger discussions and proposals are discussed in @react-native-community/discussions-and-proposals.
📄 License
React Native is MIT licensed, as found in the LICENSE file.
React Native documentation is Creative Commons licensed, as found in the LICENSE-docs file.