Skip to content

Commit

Permalink
Be compatible with React 0.14, use "invariant" package
Browse files Browse the repository at this point in the history
  • Loading branch information
amireh committed May 26, 2016
1 parent abad87d commit 1c88448
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ComponentInterpolator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var invariant = require('react/lib/invariant');
var invariant = require('invariant');
var { string, object } = React.PropTypes;

var WRAPPER_PATTERN = /(\*+)/;
Expand Down Expand Up @@ -95,7 +95,7 @@ var ComponentInterpolator = React.createClass({
},

interpolatePlaceholders(string) {
var token;
var token, child;
var tokens = string.split(PLACEHOLDER_PATTERN);
var children = [];
while (tokens.length) {
Expand Down
2 changes: 1 addition & 1 deletion dist/ComponentInterpolator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var invariant = require('react/lib/invariant');
var invariant = require('invariant');
var $__0= React.PropTypes,string=$__0.string,object=$__0.object;

var WRAPPER_PATTERN = /(\*+)/;
Expand Down
1 change: 1 addition & 0 deletions dist/invariant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
throw new Error("nonexistent module required: invariant");
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"react-tools": "0.13.x"
},
"peerDependencies": {
"react": "0.13.x"
"react": "0.13.x || 0.14.x"
},
"jest": {
"scriptPreprocessor": "test_utils/preprocessor.js",
Expand All @@ -28,6 +28,7 @@
},
"dependencies": {
"i18nliner": "^0.1.5",
"invariant": "2.2.1",
"recast": "^0.10.12",
"through2": "^0.6.3"
}
Expand Down

0 comments on commit 1c88448

Please sign in to comment.