Use UnimplementedView for CheckBox on iOS

Summary:
`CheckBox` component was introduced in v0.49.0 and not implemented on iOS.

Users who are trying to use `CheckBox` on iOS will get a warning that
> Native component for "AndroidCheckBox" does not exist

We should declare in the document that this component is Android only and use `UnimplementedView` for iOS.

- Use `react-native init` new project
- Apply pull request changes
- Add `<Checkbox />` after welcome text in `App.js`
- Run the app in iOS simulator
Closes https://github.com/facebook/react-native/pull/16211

Differential Revision: D6005393

Pulled By: hramos

fbshipit-source-id: 1c9b68b5e1c933496c4d7c2f487f0500264b603a
This commit is contained in:
Tim Wang 2017-10-07 17:17:09 -07:00 committed by Facebook Github Bot
parent 4ddc931d15
commit f9be64aea0
3 changed files with 17 additions and 2 deletions

View File

@ -27,7 +27,7 @@ type DefaultProps = {
}; };
/** /**
* Renders a boolean input. * Renders a boolean input (Android only).
* *
* This is a controlled component that requires an `onValueChange` callback that * This is a controlled component that requires an `onValueChange` callback that
* updates the `value` prop in order for the component to reflect user actions. * updates the `value` prop in order for the component to reflect user actions.

View File

@ -0,0 +1,15 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule CheckBox
* @flow
* @format
*/
'use strict';
module.exports = require('UnimplementedView');

View File

@ -12,7 +12,7 @@
const components = [ const components = [
'../Libraries/Components/ActivityIndicator/ActivityIndicator.js', '../Libraries/Components/ActivityIndicator/ActivityIndicator.js',
'../Libraries/Components/Button.js', '../Libraries/Components/Button.js',
'../Libraries/Components/CheckBox/CheckBox.js', '../Libraries/Components/CheckBox/CheckBox.android.js',
'../Libraries/Components/DatePicker/DatePickerIOS.ios.js', '../Libraries/Components/DatePicker/DatePickerIOS.ios.js',
'../Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js', '../Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js',
'../Libraries/Lists/FlatList.js', '../Libraries/Lists/FlatList.js',