This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react): add react-compat to deal with the warnings
React@15.5.0 introduced deprecation warnings for a few things and they're really annoying. So this will help prevent those warnings from logging for people using this package.
- Loading branch information
Kent C. Dodds
committed
Apr 9, 2017
1 parent
7623088
commit de50b7c
Showing
6 changed files
with
36 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* eslint import/no-mutable-exports:0, import/prefer-default-export:0 */ | ||
import React from 'react' | ||
|
||
let PropTypes | ||
|
||
/* istanbul ignore next */ | ||
if (React.version.slice(0, 4) === '15.5') { | ||
/* istanbul ignore next */ | ||
try { | ||
PropTypes = require('prop-types') | ||
/* istanbul ignore next */ | ||
} catch (error) { | ||
// ignore | ||
} | ||
} | ||
/* istanbul ignore next */ | ||
PropTypes = PropTypes || React.PropTypes | ||
|
||
export {PropTypes} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters