Summary:
Changing the the this.props.visible if to be ` if (!!this.props.visible === false)` . So passing undefined, or other values wont set the modal to be visible. Granting that anything that is not true, will set the modal to null on the render.
I make this this PR, because on the company that im working, we used a lot of RN. At the moment, we arent using anything like flow or TS. But to grant that the modals will only show if they are set visible to true i have changed the if made.
_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_
Pull Request resolved: https://github.com/facebook/react-native/pull/22072
Differential Revision: D12918086
Pulled By: TheSavior
fbshipit-source-id: 8f9c63ac6fd56d83949bb8428ad7c5b7bf805c49
Summary:
Fixes the only ESLint error pending to resolve. It was a duplicate `get` declaration.
Pull Request resolved: https://github.com/facebook/react-native/pull/22098
Differential Revision: D12918078
Pulled By: TheSavior
fbshipit-source-id: c738d6880241dbc1f1ddc06c2d4e52443c00768a
Summary:
A minor change to the comment in the Image.android.js file.
Pull Request resolved: https://github.com/facebook/react-native/pull/22092
Differential Revision: D12918066
Pulled By: TheSavior
fbshipit-source-id: f27c63241c9dde780c037edcbcdf4cc10d55d33e
Summary: This diff fixes a IllegalStateException that can happen because of a race condition when using DialogManager
Reviewed By: fkgozali
Differential Revision: D12899432
fbshipit-source-id: 98fb7c1ee1d292a959628a33c8a2dd5a6d93e328
Summary:
D12904277 was my sad, optimistic attempt to fix this crash.
As @[100006577537606:Slobodan] mentioned on T35879909, the real issue is that moduleRegistry is being created (using _moduleDataByID dict) concurrently while we try to append to this dict.
I added locks around these usage of _moduleDataByID.
Reviewed By: fkgozali
Differential Revision: D12911108
fbshipit-source-id: 2435b7a477c27585898f351c4a0d4c1bd4056756
Summary:
Related to #21581
This PR was already opened here https://github.com/facebook/react-native/pull/21600 but seems to be inactive.
Remove createReactClass from ProgressBarAndroidExample.
- `yarn run flow` && `yarn run flow-check-android` succeed.
- RNTester app ProgressBarAndroidExample on Android.
[GENERAL] [ENHANCEMENT] [ProgressBarAndroidExample.android.js] - rm createReactClass
Pull Request resolved: https://github.com/facebook/react-native/pull/21874
Reviewed By: TheSavior
Differential Revision: D12827689
Pulled By: RSNara
fbshipit-source-id: 46c70ea67dddf5d928fe936a28ef4a0a929d127f
Summary:
T35879909 is a UBN caused by a race condition in RN initialization. I haven't been able to repro, but the crash logs point to a bad memory access in this method. Another thread must be deallocating something concurrently.
This is a quick fix to patch into v197.
Reviewed By: fkgozali
Differential Revision: D12904277
fbshipit-source-id: 5740183f9a7c8f2c45ca627662891cb0c1048764
Summary:
This PR converts the use of `NativeMethodsMixin` in `CheckBox.android.js`, and converts it to an ES6-style class.
Pull Request resolved: https://github.com/facebook/react-native/pull/21585
Reviewed By: TheSavior
Differential Revision: D12827768
Pulled By: RSNara
fbshipit-source-id: c113c221335e61e015a20bbb6bcff5f9837f9022
Summary:
@public
This allows apps to specify custom lazy modules that they need to load during chrome debugging. This is because lazy modules won't be available on start up, hence these modules will be missing in JS land, causing problems.
Reviewed By: shergin
Differential Revision: D12899408
fbshipit-source-id: dca313648e994b22e3ee5afec856ef76470065f9
Summary: Simply changing RCTLogWarn() to RCTLogInfo(), since some modules can be loaded without explicit export (experimental).
Reviewed By: mdvacca
Differential Revision: D12899442
fbshipit-source-id: 524d345265eda4a601101d878d51c244a8441fb5
Summary:
AndroidManifest.xml file in UIManager only defines minimum SDK version for whole namespace "com.facebook". But it is always redefined by build.gradle file because Gradle file has precedence.
https://github.com/facebook/react-native/blob/master/ReactAndroid/build.gradle#L273
Anyway Gradle is prefered way to define it. So i think it should be removed if it is not used for another purpose.
Pull Request resolved: https://github.com/facebook/react-native/pull/22044
Differential Revision: D12898251
Pulled By: hramos
fbshipit-source-id: 087b5cc45495109b5626c9cb232d0546c53fb709
Summary: Improves the types for Easing and bezier to make them script.
Differential Revision: D10346234
fbshipit-source-id: e941110c62f7dcd17b0d022497cf29e0935db5a3
Summary:
Fixes lots of ESLint warnings. Many of them where in PR #20877 by janicduplessis which requested to split the linting fixes from configuration and package changes.
I solved only the issues that I was most certain about but I would love to get hands on all of them with a little bit of input.
Pull Request resolved: https://github.com/facebook/react-native/pull/22062
Differential Revision: D12889447
Pulled By: TheSavior
fbshipit-source-id: 35f7a08104a5b859c860afdde4af2b32c0685c50
Summary: During RN's startup, libfbjs-slow.so file is loaded when it is injected into FBReactInstanceHolder. This initialization takes a while, and has usually been showing up as a blank under `FBReactInstanceHolder`. By adding Systrace and QPL, we can estimate how long this takes. Traces will also be useful as we start optimizing this.
Reviewed By: ejanzer
Differential Revision: D5950803
fbshipit-source-id: 711c1d6c16e0f3d5c2dc23606be4e73880152b17
Summary:
There are multiple reports of the NativeViewHierarchyManager trying to remove a root view with id -1. This can occur because of a race condition caused by calls to startReactApplication + unmountReactApplication.
We unfortunately overload overload the id field of the ReactRootView to store its react tag. This id is typically set when the view is attached to the react instance, and reset to NO_ID right before an attach occurs or when the react context is tearing down. If the react context has already been initialized, attaching the root view is synchronous and the id is set immediately. If the context has not been initialized, we save the root view in a mAttachedRootViews list and wait until setupReactContext (where the context is created) to finish attaching the root views.
There were two issues:
1) In setupReactContext, synchronizing on mReactContextLock is not enough to ensure that the root views in mAttachedRootViews have been initialized already
2) In detachRootView, removing the root view from mAttachedRootViews immediately will cause mAttachedRootViews to be out of sync when it is accessed by the time it is accessed in setupReactContext
To address these, the mReactContextLock will synchronize both the creation of the react context AND the initialization of the root views and detachRootView will synchronize on the mReactContextLock before mutating the mAttachedRootViews list.
Reviewed By: mmmulani
Differential Revision: D12829677
fbshipit-source-id: 3f3b0669e5be2b570c9d534503d04e5d0816196b
Summary:
If a view inside of an inline view became dirty (e.g. its top/left prop changed), its position would not update on screen. This is because Yoga didn't know the view needed to be relaid out because Yoga's dirty signal didn't propagate all the way up to the root.
The problem is that inline views don't have a parent in the Yoga tree causing Yoga's dirtiness signal propagation to get cut off early. The fix is, when an inline views gets dirty, mark the parent Text's Yoga node as dirty. This will cause Yoga's dirtiness signal to propagate all the way up to the root node.
Yoga has a hook to inform you when your node is marked as dirty: `YGNodeSetDirtiedFunc`. We leverage this to find out when an inline view's Yoga node gets dirtied.
React Native almost handled this case. Everything worked fine as long as the inline view was nested inside of a virtual text node like this:
```
<Text>
<Text>
<InlineView />
</Text>
</Text>
```
However, the bug repros when the inline view is nested in a non-virtual text node:
```
<Text>
<InlineView />
</Text>
```
The fix is to move the special dirtiness propagation logic from `RCTVirtualTextShadowView` to `RCTBaseTextShadowView`.
**Test Plan**
Created an inline view. Tested the following kinds of updates on the inline view's content:
- Moved the content
- Removed the content
- Added the content
Tested this for an inline view that is directly inside of a text node as well as one that is nested under a virtual text node.
Here's the code I used for the inline view that moved its content after 2 seconds:
```
const RN = require('react-native');
const React = require('react');
export default class InlineView extends React.Component {
constructor(props, context) {
super(props, context);
this.state = { posBottom: false };
}
componentDidMount() {
super.componentDidMount && super.componentDidMount();
setTimeout(() => { this.setState({ posBottom: true }); }, 2000);
}
render() {
const pos = this.state.posBottom ? 25 : 0;
const color = this.state.posBottom ? 'pink' : 'green';
return (
<RN.View style={{ width: 50, height: 50, backgroundColor: 'steelblue'}}>
<RN.View style={{ width: 25, height: 25, top: pos, left: pos, backgroundColor: color }} />
</RN.View>
);
}
}
```
**Release Notes**
[IOS] [BUGFIX] [Text] - Fix case where content of inline views didn't get relaid out
Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/react-native/pull/21968
Differential Revision: D12873795
Pulled By: shergin
fbshipit-source-id: bbc9f5d3ef25063b0015cec8c4aaf2e41ecd60a8
Summary:
Changed gradle repo list to have consistent priority. mavenLocal is top priority because it requires manual setup, also won't conflict with other repos.
Pull Request resolved: https://github.com/facebook/react-native/pull/22041
Differential Revision: D12871549
Pulled By: hramos
fbshipit-source-id: c86730fde956dca77174c6454fdcb005a5eec8a9
Summary:
When we use product flavor (e.g. develop/production) with Android Gradle Plugin 3.2,
javascript bundle is not copied due to that merged asset path point to incorrect location.
related #21408
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/21782
Differential Revision: D12854056
Pulled By: hramos
fbshipit-source-id: d1e6a395e762cc4a4f133977d54d0f469fa66b8c
Summary: Adds copyright headers to all files that are missing them.
Reviewed By: hramos
Differential Revision: D12837494
fbshipit-source-id: 6330a18919676dec9ff2c03b7c9329ed9127d930
Summary: This function sometimes causes an "Unable to find node on an unmounted component" crash during pagination for reasons that still need to be investigated; in the meanwhile, wrap this in a try-catch block to mitigate the crash.
Reviewed By: sahrens
Differential Revision: D12829971
fbshipit-source-id: bc9fe5b9b8c03430ff890bfbb27c39aa270c9eb7
Summary:
Fix the lazily LaodedView to avoid weird naming issues
This makes more sense. i would like to not have this suffix Manager at all in play, but it is possible that some of the names should be tweaked for that. Since TurboModule is coming we should probably not invest in that removal.
Reviewed By: dshahidehpour
Differential Revision: D12831482
fbshipit-source-id: 1cc557cf0bdfaca35032f75823b2facb778dc3ac
Summary:
This PR bumps also fbjs-scripts to latest version. Benefit is smaller node_modules and less deps to download as newer version doesn't depend on babel6 anymore.
Pull Request resolved: https://github.com/facebook/react-native/pull/21880
Differential Revision: D12832002
Pulled By: hramos
fbshipit-source-id: fa801aeb70a2f22be6f9c05cd6d981d0af0a0da9
Summary:
This diff introduces a new integration concept (called RuntimeExecutor) which consolidates `Runtime` and the dispatching mechanism.
As simple as that:
`using RuntimeExecutor = std::function<void(std::function<void(facebook::jsi::Runtime &runtime)> &&callback)>;`
Reviewed By: fkgozali
Differential Revision: D12816746
fbshipit-source-id: 9e27ef16b98af861d494fe50c7e50bd0536e6aaf
Summary:
Adds the displayName prop to `View` and `Text` components. Because these now use `React.forwardRef`, they were showing as `Component` instead of their actual names.
Thanks to ljharb for helping to pinpoint the source of the issue!
Fixes#21937
Pull Request resolved: https://github.com/facebook/react-native/pull/21950
Differential Revision: D12827060
Pulled By: TheSavior
fbshipit-source-id: d812cae14d53ad821ab5873e737db63ad1a989e3
Summary: The annotation ReactModuleList that was processed by ReactModuleSpecProcessor.java does not use ViewManagers. Removing this method from the annotation so that there is no confusion on how view managers are added to individual packages.
Reviewed By: achen1
Differential Revision: D9115363
fbshipit-source-id: 43d12e09b0e9b8e1732533f9a4456327778a0eaf