supermedium / aframe-react

:atom: Build virtual reality experiences with A-Frame and React.
https://ngokevin.github.io/aframe-react-boilerplate/
MIT License
1.42k stars 151 forks source link

PropTypes deprecated warnings with React 15.5.0 #75

Closed avantcontra closed 7 years ago

avantcontra commented 7 years ago

Hi, any plan to fix the warning with React 15.5.0:

Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead

https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html

In 15.5, instead of accessing PropTypes from the main React object, install the prop-types package and import them from there:

// Before (15.4 and below)
import React from 'react';

class Component extends React.Component {
  render() {
    return <div>{this.props.text}</div>;
  }
}

Component.propTypes = {
  text: React.PropTypes.string.isRequired,
}

// After (15.5)
import React from 'react';
import PropTypes from 'prop-types';

class Component extends React.Component {
  render() {
    return <div>{this.props.text}</div>;
  }
}

Component.propTypes = {
  text: PropTypes.string.isRequired,
};
ngokevin commented 7 years ago

Thanks, I can get to it on Monday, or I can take a PR if anyone is free until then.

ngokevin commented 7 years ago

I'll leave this if anyone wants to PR, should be an easy fix :)

ngokevin commented 7 years ago

Fixed v4.1.0