react-isomorphic-tools
Advanced tools
Comparing version 1.0.9 to 1.0.10
{ | ||
"name": "react-isomorphic-tools", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "Authorization, Fetcher, Preload. Tools for ServerSide rendering", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -32,6 +32,8 @@ 'use strict'; | ||
var _reactDisplayName = require('react-display-name'); | ||
var _reactDisplayName2 = _interopRequireDefault(_reactDisplayName); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// import getDisplayName from 'react-display-name' | ||
var preload = function preload(_preload) { | ||
@@ -44,11 +46,5 @@ return function (Component) { | ||
function Preload(props) { | ||
function Preload() { | ||
(0, _classCallCheck3.default)(this, Preload); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (Preload.__proto__ || (0, _getPrototypeOf2.default)(Preload)).call(this, props)); | ||
_this.getDisplayName = function () { | ||
return props.location.pathname; | ||
}; | ||
return _this; | ||
return (0, _possibleConstructorReturn3.default)(this, (Preload.__proto__ || (0, _getPrototypeOf2.default)(Preload)).apply(this, arguments)); | ||
} | ||
@@ -63,3 +59,3 @@ | ||
return Preload; | ||
}(_react2.default.Component), _class.displayName = 'Preload(' + undefined.getDisplayName() + ')', _class.preload = _preload, _temp; | ||
}(_react2.default.Component), _class.displayName = 'Preload(' + (0, _reactDisplayName2.default)(Component) + ')', _class.preload = _preload, _temp; | ||
}; | ||
@@ -66,0 +62,0 @@ }; |
import React from 'react' | ||
// import getDisplayName from 'react-display-name' | ||
import getDisplayName from 'react-display-name' | ||
const preload = preload => Component => class Preload extends React.Component { | ||
constructor(props){ | ||
super(props); | ||
this.getDisplayName = () => { | ||
return props.location.pathname | ||
} | ||
} | ||
static displayName = `Preload(${this.getDisplayName()})` | ||
static displayName = `Preload(${getDisplayName(Component)})` | ||
static preload = preload | ||
@@ -14,0 +7,0 @@ render(){ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61081
1432