react-native/docs/KnownIssues.md

98 lines
5.7 KiB
Markdown
Raw Normal View History

---
id: known-issues
title: Known Issues
layout: docs
category: Guides
permalink: docs/known-issues.html
2015-09-30 13:42:56 +00:00
next: performance
---
### Devtools "React" Tab Does Not Work
It's [currently not possible](https://github.com/facebook/react-devtools/issues/229) to use the "React" tab in the devtools to inspect app widgets. This is due to a change in how the application scripts are evaluated in the devtools plugin; they are now run inside a Web Worker, and the plugin is unaware of this and so unable to communicate properly with React Native.
However, you can still use the Console feature of the devtools, and debugging JavaScript with breakpoints works too. To use the console, make sure to select the `⚙debuggerWorker.js` entry in the devtools dropdown that by default is set to `<top frame>`.
2015-09-15 06:32:45 +00:00
### Missing Modules and Native Views
2015-10-05 17:53:00 +00:00
2015-09-15 06:32:45 +00:00
This is an initial release of React Native Android and therefore not all of the views present on iOS are released on Android. We are very much interested in the communities' feedback on the next set of modules and views for Open Source. Not all native views between iOS and Android have a 100% equivalent representation, here it will be necessary to use a counterpart eg using ProgressBar on Android in place of ActivityIndicator on iOS.
Our provisional plan for common views and modules includes:
2015-09-15 06:32:45 +00:00
#### Views
```
2015-09-15 06:32:45 +00:00
ART
Maps
2015-10-27 16:42:02 +00:00
Modal
2015-12-06 23:39:37 +00:00
Spinner (http://developer.android.com/guide/topics/ui/controls/spinner.html)
2015-09-15 06:32:45 +00:00
Webview
```
2015-09-15 06:32:45 +00:00
#### Modules
```
2015-11-26 18:07:17 +00:00
Alert
2015-09-15 06:32:45 +00:00
App State
2015-11-26 18:07:17 +00:00
Camera Roll
2015-09-15 06:32:45 +00:00
Dialog
Media
Pasteboard
2015-10-27 17:01:23 +00:00
PushNotificationIOS
```
2015-09-15 06:32:45 +00:00
2015-09-16 18:53:26 +00:00
### Some props are only supported on one platform
2015-10-05 15:51:28 +00:00
2015-09-16 18:54:49 +00:00
There are properties that work on one platform only, either because they can inherently only be supported on that platform or because they haven't been implemented on the other platforms yet. All of these are annotated with `@platform` in JS docs and have a small badge next to them on the website. See e.g. [Image](https://facebook.github.io/react-native/docs/image.html).
2015-09-16 18:49:06 +00:00
2015-10-05 15:51:28 +00:00
### Platform parity
2015-10-05 17:53:00 +00:00
There are known cases where the APIs could be made more consistent across iOS and Android:
2015-10-05 15:51:28 +00:00
2015-11-19 18:10:40 +00:00
- `<AndroidViewPager>` and `<ScrollView pagingEnabled={true}>` on iOS do a similar thing. We might want to unify them to `<ViewPager>`.
2015-10-05 16:20:13 +00:00
- `alert()` needs Android support (once the Dialogs module is open sourced)
2015-10-05 16:23:57 +00:00
- It might be possible to bring `LinkingIOS` and `IntentAndroid` (to be open sourced) closer together.
- `ActivityIndicator` could render a native spinning indicator on both platforms (currently this is done using `ActivityIndicatorIOS` on iOS and `ProgressBarAndroid` on Android).
2015-11-19 18:10:40 +00:00
- `ProgressBar` could render a horizontal progress bar on both platforms (on iOS this is `ProgressViewIOS`, on Android it's `ProgressBarAndroid`).
2015-10-05 15:51:28 +00:00
2015-11-24 15:19:25 +00:00
### Using 3rd-party native modules
2015-09-15 06:32:45 +00:00
2015-11-26 18:01:53 +00:00
There are many awesome 3rd-party modules: https://react.parts/native
2015-11-24 15:19:25 +00:00
Adding these to your apps should be made simpler. Here's [an example](https://github.com/apptailor/react-native-google-signin) how this is done currently.
2015-09-15 06:32:45 +00:00
### The `overflow` style property defaults to `hidden` and cannot be changed on Android
2015-09-15 06:32:45 +00:00
This is a result of how Android rendering works. This feature is not being worked on as it would be a significant undertaking and there are many more important tasks.
Another issue with `overflow: 'hidden'` on Android: a view is not clipped by the parent's `borderRadius` even if the parent has `overflow: 'hidden'` enabled the corners of the inner view will be visible outside of the rounded corners. This is only on Android; it works as expected on iOS. See a [demo of the bug](https://rnplay.org/apps/BlGjdQ) and the [corresponding issue](https://github.com/facebook/react-native/issues/3198).
2015-09-15 06:32:45 +00:00
2015-11-26 17:39:15 +00:00
### View shadows
2015-11-26 17:39:15 +00:00
The `shadow*` [view styles](/react-native/docs/view.html#style) apply on iOS, and the `elevation` view prop is available on Android. Setting `elevation` on Android is equivalent to using the [native elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation), and has the same limitations (most significantly, it only works on Android 5.0+). Setting `elevation` on Android also affects the z-order for overlapping views.
2015-11-24 15:19:25 +00:00
### Android M permissions
The open source version of React Native doesn't yet support the [Android M permission model](http://developer.android.com/training/permissions/requesting.html).
2015-09-15 06:32:45 +00:00
### Layout-only nodes on Android
An optimization feature of the Android version of React Native is for views which only contribute to the layout to not have a native view, only their layout properties are propagated to their children views. This optimization is to provide stability in deep view hierarchies for React Native and is therefore enabled by default. Should you depend on a view being present or internal tests incorrectly detect a view is layout only it will be necessary to turn off this behavior. To do this, set `collapsable` to false as in this example:
```
2015-09-15 06:32:45 +00:00
<View collapsable={false}>
...
</View>
```
2015-09-15 06:32:45 +00:00
### Memory issues with PNG images
2015-09-15 06:32:45 +00:00
React Native Android depends on [Fresco](https://github.com/facebook/fresco) for loading and displaying images. Currently we have disabled downsampling because it is experimental, so you may run into memory issues when loading large PNG images.
2015-10-13 22:24:44 +00:00
### react-native init hangs
Try running `react-native init` with `--verbose` and see [#2797](https://github.com/facebook/react-native/issues/2797) for common causes.
2015-10-15 13:07:47 +00:00
### Text Input Border
The text input has by default a border at the bottom of its view. This border has its padding set by the background image provided by the system, and it cannot be changed. Solutions to avoid this is to either not set height explicitly, case in which the system will take care of displaying the border in the correct position, or to not display the border by setting underlineColor to transparent.