Skip to content

Commit

Permalink
Add description to require a key for each child in ViewPageAndroid
Browse files Browse the repository at this point in the history
Summary:
Change the header description and example code.

Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?

Clarify extra requirements for a Component.

A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.

Go to documentation, see changes.

If you have added code that should be tested, add tests.

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.

For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.

[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes facebook/react-native#13829

Differential Revision: D5661106

Pulled By: hramos

fbshipit-source-id: 39736c05f8017009cdd637930c9f89ae6c2ee7c3
  • Loading branch information
HuyAnhh authored and facebook-github-bot committed Oct 18, 2017
1 parent 115f598 commit 4e4c0ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ViewPagerAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type ViewPagerScrollState = $Enum<{
*
* It is important all children are `<View>`s and not composite components.
* You can set style properties like `padding` or `backgroundColor` for each
* child.
* child. It is also important that each child have a `key` prop.
*
* Example:
*
Expand All @@ -47,10 +47,10 @@ export type ViewPagerScrollState = $Enum<{
* <ViewPagerAndroid
* style={styles.viewPager}
* initialPage={0}>
* <View style={styles.pageStyle}>
* <View style={styles.pageStyle} key="1">
* <Text>First page</Text>
* </View>
* <View style={styles.pageStyle}>
* <View style={styles.pageStyle} key="2">
* <Text>Second page</Text>
* </View>
* </ViewPagerAndroid>
Expand Down

0 comments on commit 4e4c0ff

Please sign in to comment.