Skip to content

Commit 20e1eca

Browse files
authored
Update README.md (#103)
Add Image as allowed types for values. Also, made the linking instructions for older version of React Native to be expandable to avoid confusion
1 parent f09b54e commit 20e1eca

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `@react-native-community/segmented-control`
22

3-
![Supports iOS and Android][support-badge]![CircleCI branch][circle-ci-badge] ![npm][npm-badge] [![Lean Core Extracted][lean-core-badge]][lean-core-issue]
3+
![Supports iOS and Android and Web][support-badge]![CircleCI branch][circle-ci-badge] ![npm][npm-badge] [![Lean Core Extracted][lean-core-badge]][lean-core-issue]
44

55
React Native SegmentedControl library. Use SegmentedControl to render a UISegmentedControl iOS.
66

@@ -26,11 +26,19 @@ npm install --save @react-native-community/segmented-control
2626

2727
## Link
2828

29-
- React Native 0.60+
29+
### React Native 0.60+
3030

31-
run `npx pod-install`
31+
The package is [automatically linked](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) when building the app. All you need to do is:
3232

33-
- React Native <= 0.59
33+
```sh
34+
npx pod-install
35+
```
36+
37+
For android, no linking is needed, as the module is implemented in js.
38+
39+
<details>
40+
<summary>For React Native version 0.59 or older</summary>
41+
### React Native <= 0.59
3442

3543
run `react-native link @react-native-community/segmented-control`
3644

@@ -42,6 +50,8 @@ New React Native comes with `autolinking` feature, which automatically links Nat
4250

4351
`react-native unlink @react-native-community/segmented-control`
4452

53+
</details>
54+
4555
## Migrating from the core `react-native` module
4656

4757
This module was created when the segmentedControlIos was split out from the core of React Native. To migrate to this module you need to follow the installation instructions above and then change you imports from:
@@ -167,7 +177,7 @@ The labels for the control's segment buttons, in order.
167177

168178
| Type | Required |
169179
| --------------- | -------- |
170-
| array of string | No |
180+
| (string|number|Image)[] | No |
171181

172182
### `appearance`
173183

0 commit comments

Comments
 (0)