Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove React.createClass and React.PropTypes from docs #9355

Closed

Commits on Apr 5, 2017

  1. Update React.createComponent to createReactComponent in the docs

    The `React.createComponent` method is being deprecated in favor of
    `createReactComponent`.
    flarnie committed Apr 5, 2017
    Configuration menu
    Copy the full SHA
    b9918a0 View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2017

  1. Remove 'React.createClass' from top level API docs

    It no longer makes sense to have a section for the 'createClass' method
    in this page, since it won't be available as a top level method on
    'React'.
    
    I initially was going to pull the section about 'createClass' into a
    separate page to add under 'addons' but it was short and duplicative of
    the 'react-without-es6' docs. So I just linked to those.
    flarnie committed Apr 6, 2017
    Configuration menu
    Copy the full SHA
    62b3f9a View commit details
    Browse the repository at this point in the history
  2. Remove *most* React.PropTypes from the docs

    I am doing the docs for `context` in a separate commit because that case
    was a bit less clear-cut.
    
    We will no longer support `React.PropTypes` as a built-in feature of
    React, and instead should direct folks to use the `PropTypes` project
    that stands alone.
    
    Rather than retaining the `React.PropTypes` examples and just revamping
    them to show the use of the stand-alone `PropTypes` library with React,
    it makes more sense to direct people to that project and reduce the
    perceived API area and complexity of React core. The proper place to
    document `PropTypes` is in the README or docs of that project, not in
    React docs.
    flarnie committed Apr 6, 2017
    Configuration menu
    Copy the full SHA
    735e159 View commit details
    Browse the repository at this point in the history
  3. Update context docs to not use React.PropTypes

    We use `React.PropTypes` to define the `contextType` for the `context`
    feature of React. It's unclear how this will work once `React.PropTypes`
    is replaced by the external `PropTypes` library. Some options;
    
    a) Deprecate `context`, either in v16 or shortly after. Seems reasonable
    based on the intense warnings against using context that we have in the
    docs -
    https://facebook.github.io/react/docs/context.html#why-not-to-use-context
    **Except** that probably some widely used libraries depend on it, like
    `React-Router`.
    
    b) Expect users will use external `PropTypes` library when defining
    `contextTypes` and just don't do our `checkReactTypeSpec` against them
    any more in v16.
    
    c) Stop masking context and pass the whole context
    unmasked everywhere. Worst option, do not recommend.
    
    I went with `b` and assume that, for now, we will get users to use the
    external `PropTypes` when defining context. I will update this PR if we
    want a different approach.
    flarnie committed Apr 6, 2017
    Configuration menu
    Copy the full SHA
    ce94f3e View commit details
    Browse the repository at this point in the history