React-native: ViewPropTypes warns but documentation missing/link broken

Created on 16 May 2017  路  2Comments  路  Source: facebook/react-native

Description

Attempted to use a library that uses View.propTypes. Got a warning: Warning: View.propTypes has been deprecated and will be removed in a future version of ReactNative. Use ViewPropTypes instead yet looking up ViewPropTypes yields nothing on the official site and Google only contains results about issues on other projects.

Reproduction Steps and Sample Code

List all the steps required to reproduce the issue you're reporting. These steps should be clear and concise.

An example of your code is REQUIRED

export default class SomeClass extends React.PureComponent {
  static propTypes = {
    style: View.propTypes.style,
  }
  // ...
}

Documentation for View is currently linking to /viewproptypes.html#props which just forwards to "Getting Started" instead.

Solution

Provide at documentation page for ViewPropTypes that list how to use it. I eventually found (by browsing the RN code base) that you can import ViewPropTypes from 'react-native' package like this:

import {Text, View, ViewPropTypes} from 'react-native';

Additional Information

  • React Native version: [email protected]
  • Platform: iOS (and likely Android - untested)
  • Development Operating System: macOS 10.12.4 (16E195)
  • Dev tools: Xcode, iOS Simulator with 10.3 SDK/iPhone 6.
Locked

Most helpful comment

I think this should be reopened

All 2 comments

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

I think this should be reopened

Was this page helpful?
0 / 5 - 0 ratings