React.createClass is deprecated
stevenhao opened this issue · 0 comments
This issue causes a development-only warning in projects using the mdg:flow-router-extensions
package.
Warning: ReactClassPrototypePrototype: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.
This issue is a bit tricky, because we already correctly extend the React.Component
class instead of using React.createClass
when making components. The only time React.createClass
is called is here. It appears that this code snippet follows the discussion in this thread. This hack is necessary is to account for the subtle differences between classes created by React.createClass
and the React.Component
class.
There are a number of solutions that should work, including:
- Use the
create-react-class
package (which can be used as a drop-in replacement) - Use the undocumented prototype property
React.Component.prototype.isReactComponent