mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-11 16:29:43 +08:00
4fd0442482b4e96d7a26e09bb63b6515f923699b
reference: https://github.com/wix/react-native-navigation/issues/2892 in short, javascript A && B syntax will return A if A is false. if A is empty string, it will return empty string (which is false if evaluated as boolean) this most of the time works but not here. {A && `<Text>sth</Text>`}, will return "" when A is empty string. This have no problem in iPhone, but returning an empty string to rn component other that` <Text> `will crash in android. The fatal error message can only be viewed using android device monitor or logcat, no message will show in console (as it is a flash crash). To reproduce, put an empty string in subtitle. the double !! first turn empty string '' to true and then false. return false or null is save within JSX 07-26 21:07:41.735: E/AndroidRuntime(16154): java.lang.RuntimeException: abi26_0_0.com.facebook.react.uimanager.IllegalViewOperationException: Trying to add unknown view tag: 1472 07-26 21:07:41.735: E/AndroidRuntime(16154): detail: View tag:1479 07-26 21:07:41.735: E/AndroidRuntime(16154): children(2): [ 07-26 21:07:41.735: E/AndroidRuntime(16154): 1468,1470, 07-26 21:07:41.735: E/AndroidRuntime(16154): ], 07-26 21:07:41.735: E/AndroidRuntime(16154): viewsToAdd(1): [ 07-26 21:07:41.735: E/AndroidRuntime(16154): [2,1472], 07-26 21:07:41.735: E/AndroidRuntime(16154): ], 07-26 21:07:41.735: E/AndroidRuntime(16154): at abi26_0_0.com.facebook.react.bridge.ReactContext.handleException(ReactContext.java:313) 07-26 21:07:41.735: E/AndroidRuntime(16154): at abi26_0_0.com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:33) <!-- Please provide enough information so that others can review your pull request. --> <!-- Keep pull requests small and focused on a single change. --> ### Motivation <!-- What existing problem does the pull request solve? Can you solve the issue with a different approach? --> ### Test plan <!-- List the steps with which we can test this change. Provide screenshots if this changes anything visual. -->
Material design for React Native.
Features
- Follows material design guidelines
- Works on both iOS and Android following platform adaptation guidelines
- Full theming support
Currently supported React Native version: >= 0.50.3
Try it out
Run the example app with Expo to see it in action.
The source code for the examples are under the /example folder.
Getting Started
Refer to the getting started guide for instructions.
Documentation
Check the components and their usage in our documentation.
Contributing
Read the contribution guidelines before contributing.
Description
Languages
TypeScript
90.7%
JavaScript
8.5%
Shell
0.4%
CSS
0.3%
