Summary: As RCTNativeModule can be destructed at any time, it's unsafe to capture "this" in a callback.
Reviewed By: javache
Differential Revision: D5963728
fbshipit-source-id: c80a01c851d97813e4fead2b31c442eaeb8ae204
Summary:
If you are a product developer and you need to fix your app's issues related to iPhone X limitations asap,
you can temporary use `DeviceInfo.isIPhoneX_deprecated`.
You can, but you should not. Please consider use new <SafeAreaView>.
This prop was initially named so ugly because we are trying to discourage the community to use it.
However, we understand that sometimes we need a "band-aid" to prevent our apps bleeding.
Note: This prop (DeviceInfo.isIPhoneX_deprecated) will be removed completely after 06/18.
Reviewed By: fkgozali
Differential Revision: D5946329
fbshipit-source-id: 5d6dcaf0e2d175327d59cde4b5ec2e01cd77ec70
Summary:
Reasons:
* It is more clear and readable;
* It is more semantical;
* It allows us to add some magic (and complexity, to be fair) to the RCTExecuteOnUIManagerQueue. (See next diffs in the stack.)
Reviewed By: javache
Differential Revision: D5935466
fbshipit-source-id: aeb18d6e11c047eb19182a656da581b6ce073602
Summary:
This fixes [#15801](https://github.com/facebook/react-native/issues/15801)
We ran into a strange crash on iOS (debug only). After removing the clutter I was able to reproduce it in a tiny app. You can check it out [here.](https://github.com/simonracz/textinput_stress)
The UI in JS and native are not always in sync (which is okay). Due to this, a native view might call back into JS, which is no longer present in the shadow view hierarchy there. I think this should be also okay.
TextInput in some cases calls into [setIntrinsicContentView](6d67e2dbbc/React/Modules/RCTUIManager.m (L382)), where it triggers an overly enthusiastic `NSAssert` and crashes the app.
Check out [textinput_stress](https://github.com/simonracz/textinput_stress)
Rotate the simulator a few times to see the crash or the lack of crash.
Closes https://github.com/facebook/react-native/pull/16170
Differential Revision: D5959776
Pulled By: shergin
fbshipit-source-id: f39f5a3f1d86b330ecf7cbccd90871bc01fd69d9
Summary:
This is required for D5874536, wherein I'll be introducing direction-aware props for borders.
When a view's border changes due to a direction update, only the frames of its children update. Therefore, only the children `UIView`s get a chance to be re-rendered. This is incorrect because the view that's had its borders changed also needs to re-render. So, I keep a track of the layout direction in a property on all shadow views. Then, when I update that prop within `applyLayoutNode`, I push shadow views into the `viewsWithNewFrames` set.
Reviewed By: mmmulani
Differential Revision: D5944488
fbshipit-source-id: 3f23e9973f3555612920703cdb6cec38e6360d2d
Summary: Now it compiles and works.
Reviewed By: fromcelticpark
Differential Revision: D5952026
fbshipit-source-id: df0408108ab29b77592d78b29553d2e65686f2f2
Summary:
Basic implementation of the proposal in #15271
Note that this should not affect facebook internally since they are not using OSS releases.
Points to consider:
- How strict should the version match be, right now I just match exact versions.
- Wasn't able to use haste for ReactNativeVersion because I was getting duplicate module provider caused by the template file in scripts/versiontemplates. I tried adding the scripts folder to modulePathIgnorePatterns in package.json but that didn't help.
- Redscreen vs. warning, I think warning is useless because if the app crashes you won't have time to see the warning.
- Should the check and native modules be __DEV__ only?
**Test plan**
Tested that it works when version match and that it redscreens when versions don't before getting other errors on Android and iOS.
Closes https://github.com/facebook/react-native/pull/15518
Differential Revision: D5813551
Pulled By: hramos
fbshipit-source-id: 901757e25724b0f22bf39de172b56309d0dd5a95
Summary: Because `RCTUIManager` is already overcomplicated and that stuff deserves separate file and header.
Reviewed By: javache
Differential Revision: D5856653
fbshipit-source-id: 7001bb8ba611976bf3b82d6a25f5619810a35b34
Summary:
This issue has been open for a really long time, but I'm pretty sure this is the line that needed to change:
https://github.com/facebook/react-native/issues/1831
What was happening here is that `CGRectIsEmpty` returns true when either height or width is zero. With the current logic, one of those would always be zero when the parent was rendered off screen. This ensures that there the intersection be of CGSizeZero for the view to actually be clipped.
That being said, there seems to be something more complex going on here that I'm not understanding? I would think that you'd simply want to check if the child view's frame is within the bounds of the parent at all. If it was, then don't clip it. If I'm in the wrong, could someone explain this a bit more? If so, I'll fix this issue.
Using this [repository](https://github.com/jcharlet/react_native_listview_bug), this one line change fixes the issue and still clips cells as they are scrolled off screen.
Closes https://github.com/facebook/react-native/pull/15669
Differential Revision: D5815056
Pulled By: shergin
fbshipit-source-id: 32382e4954139e4d5af67d786422fd87173b1a1a
Summary: As per the comment, <Modal> uses entering/leaving the view hierarchy as a cue to show/hide the modal. By re-adding it, we are causing a bunch of confusion.
Reviewed By: shergin
Differential Revision: D5893607
fbshipit-source-id: ecd05799751a9bba843998ae93f24fe35edca8b4
Summary:
<SafeAreaView> renders nested content and automatically applies paddings reflect the portion of the view
that is not covered by navigation bars, tab bars, toolbars, and other ancestor views.
Moreover, and most importantly, Safe Area's paddings feflect physical limitation of the screen,
such as rounded corners or camera notches (aka sensor housing area on iPhone X).
Reviewed By: mmmulani
Differential Revision: D5886411
fbshipit-source-id: 7ecc7aa34de8f5527c4e59b0fb4efba3aaea28c8
Summary:
In some cases we need a way to specify some environmental data to shadow view
to improve layout (or do something similar), so `localData` serves these needs.
For example, any stateful embedded native views may benefit from this.
Have in mind that this data is not supposed to interfere with the state of
the shadow view.
Reviewed By: mmmulani
Differential Revision: D5884711
fbshipit-source-id: f0bf66e4608894ec4479b8aca262afcfba6b9f4b
Summary: Adds an onDismiss so that navigation events can be chained to the dismissing of a modal.
Reviewed By: sahrens
Differential Revision: D5852953
fbshipit-source-id: a86e36fdd5b0b206c2dd9fa248e2a88da22efa31
Summary:
This should be much more performant (and it better illustrates the intension of the code).
The fix was suggested by Adlai-Holler.
Reviewed By: mmmulani
Differential Revision: D5851595
fbshipit-source-id: 45d172a5fa796549c6dcea8f35c5cbb2a4c2d2e0
Summary:
iOS 11 now requires this to be accessed on the main thread.
I think this is causing tests to fail, as the Main Thread Checker is turned on there.
Reviewed By: javache
Differential Revision: D5826570
fbshipit-source-id: 6acb7174c756a2ad657602f14c666f71b1ee8fe9
Summary:
Remove fallback logic.
It is hard to test whether a bundle is good or bad on device, since it does the fallback, remove the fallback logic now.
Reviewed By: javache
Differential Revision: D5773542
fbshipit-source-id: 8bb4fdad4c5761ccce915f9f1c2577464e8d37d8