Skip to content

Can't isomorphically check propTypes in react-dom-stream SSR without warnings in React 15.2+ #7765

@jedwards1211

Description

@jedwards1211

aickin/react-dom-stream#22

react-dom-stream helpfully checks propTypes while rendering static HTML to a stream. But of course React 15.2+ warns (in this case on a user Html Component with propTypes.head):

Warning: You are manually calling a React.PropTypes validation function for the head prop on Html. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.

The page at that link advises 3rd party libraries to use external PropType libraries, but that won't work in this case because react-dom-stream is trying to call the propTypes the user has put on their components, rather than providing helpers like the 3rd party libraries the author of that page seems to be considering (e.g. ImmutablePropTypes). To prevent these errors, the user would have to remove the propTypes on their components or replace the usages of React.PropTypes in their own code with some other library. If they were using 3rd party components that declare propTypes, they would be out of luck.

Is there an intended solution to this or was this conflict unanticipated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions