mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 17:45:59 +00:00
63c2ab3eb1
Summary: Fixes #11209 Updating action items in a `ToolbarAndroid`, or more specifically the native `ReactToolbar`, after the initial render presently will not always work as expected - typically manifesting itself as new action items not being displayed at all (under certain circumstances). This seems to be happening because Fresco gets back to us asynchronously and updates the `MenuItem` in a listener. However when a keyboard is displayed the `Toolbar` is in a weird state where updating the `MenuItem` doesn't automatically trigger a layout. The solution is to trigger one manually. This is a bit wacky, so I created a sample project: https://github.com/Benjamin-Dobell/DynamicToolbar `master` demonstrates the problem. Run the project, the toolbar action item is scheduled to update every 2 seconds. It works fine _until_ you give the `TextInput` focus. Once you give it focus the action item disappears and it never recovers (despite on-going renders due to state changes). You can then checkout the `fixed` branch, run `yarn` again, and see that problem is fixed. This branch is using a prebuilt version of React Native with this patch applied. Of course you could (and probably should) also modify `master` to use a version of RN built by the Facebook CI (assuming that's a thing you guys do). Closes https://github.com/facebook/react-native/pull/13876 Differential Revision: D5476858 Pulled By: shergin fbshipit-source-id: 6634d8cb3ee18fd99f7dc4e1eef348accc1c45ad
Building React Native for Android
See the docs on the website.
Running tests
When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing.