react-router-controller
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -39,3 +39,4 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
basename = _props.basename, | ||
hot = _props.hot; | ||
hot = _props.hot, | ||
preact = _props.preact; | ||
@@ -45,3 +46,8 @@ return React.createElement( | ||
this.props, | ||
React.createElement(RouteController, { historyType: 'browser', basename: basename, hot: hot }) | ||
React.createElement(RouteController, { | ||
historyType: 'browser', | ||
basename: basename, | ||
hot: hot, | ||
preact: preact | ||
}) | ||
); | ||
@@ -48,0 +54,0 @@ } |
@@ -39,3 +39,4 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
basename = _props.basename, | ||
hot = _props.hot; | ||
hot = _props.hot, | ||
preact = _props.preact; | ||
@@ -45,3 +46,8 @@ return React.createElement( | ||
this.props, | ||
React.createElement(RouteController, { historyType: 'hash', basename: basename, hot: hot }) | ||
React.createElement(RouteController, { | ||
historyType: 'hash', | ||
basename: basename, | ||
hot: hot, | ||
preact: preact | ||
}) | ||
); | ||
@@ -48,0 +54,0 @@ } |
@@ -39,3 +39,4 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
basename = _props.basename, | ||
hot = _props.hot; | ||
hot = _props.hot, | ||
preact = _props.preact; | ||
@@ -45,3 +46,8 @@ return React.createElement( | ||
this.props, | ||
React.createElement(RouteController, { historyType: 'memory', basename: basename, hot: hot }) | ||
React.createElement(RouteController, { | ||
historyType: 'memory', | ||
basename: basename, | ||
hot: hot, | ||
preact: preact | ||
}) | ||
); | ||
@@ -48,0 +54,0 @@ } |
@@ -28,2 +28,4 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
*@this { string } pathname 相当与上个页面的pathname,切换页面会变化。 | ||
*@this { boolean } hot 开启热替换,热替换跟生产环境的会有点不一样 | ||
*@this { boolean } preact preact和react的热替换有点不一样 | ||
*/ | ||
@@ -158,5 +160,10 @@ var RouteController = (_temp2 = _class = function (_React$Component) { | ||
//begin--热替换开启处理 | ||
var hot = nextProps.hot; | ||
var hot = nextProps.hot, | ||
preact = nextProps.preact; | ||
if (hot !== this.hot) { | ||
if (preact) { | ||
//preact热替换跟react有点不一样 | ||
return true; | ||
} | ||
//hot不相等时,不渲染上个未变化的页面 | ||
@@ -163,0 +170,0 @@ this.hot = hot; |
@@ -52,3 +52,4 @@ 'use strict'; | ||
basename = _props.basename, | ||
hot = _props.hot; | ||
hot = _props.hot, | ||
preact = _props.preact; | ||
@@ -58,3 +59,8 @@ return _react2.default.createElement( | ||
this.props, | ||
_react2.default.createElement(_RouteController2.default, { historyType: 'browser', basename: basename, hot: hot }) | ||
_react2.default.createElement(_RouteController2.default, { | ||
historyType: 'browser', | ||
basename: basename, | ||
hot: hot, | ||
preact: preact | ||
}) | ||
); | ||
@@ -61,0 +67,0 @@ } |
@@ -52,3 +52,4 @@ 'use strict'; | ||
basename = _props.basename, | ||
hot = _props.hot; | ||
hot = _props.hot, | ||
preact = _props.preact; | ||
@@ -58,3 +59,8 @@ return _react2.default.createElement( | ||
this.props, | ||
_react2.default.createElement(_RouteController2.default, { historyType: 'hash', basename: basename, hot: hot }) | ||
_react2.default.createElement(_RouteController2.default, { | ||
historyType: 'hash', | ||
basename: basename, | ||
hot: hot, | ||
preact: preact | ||
}) | ||
); | ||
@@ -61,0 +67,0 @@ } |
@@ -52,3 +52,4 @@ 'use strict'; | ||
basename = _props.basename, | ||
hot = _props.hot; | ||
hot = _props.hot, | ||
preact = _props.preact; | ||
@@ -58,3 +59,8 @@ return _react2.default.createElement( | ||
this.props, | ||
_react2.default.createElement(_RouteController2.default, { historyType: 'memory', basename: basename, hot: hot }) | ||
_react2.default.createElement(_RouteController2.default, { | ||
historyType: 'memory', | ||
basename: basename, | ||
hot: hot, | ||
preact: preact | ||
}) | ||
); | ||
@@ -61,0 +67,0 @@ } |
@@ -46,2 +46,4 @@ 'use strict'; | ||
*@this { string } pathname 相当与上个页面的pathname,切换页面会变化。 | ||
*@this { boolean } hot 开启热替换,热替换跟生产环境的会有点不一样 | ||
*@this { boolean } preact preact和react的热替换有点不一样 | ||
*/ | ||
@@ -176,5 +178,10 @@ var RouteController = (_temp2 = _class = function (_React$Component) { | ||
//begin--热替换开启处理 | ||
var hot = nextProps.hot; | ||
var hot = nextProps.hot, | ||
preact = nextProps.preact; | ||
if (hot !== this.hot) { | ||
if (preact) { | ||
//preact热替换跟react有点不一样 | ||
return true; | ||
} | ||
//hot不相等时,不渲染上个未变化的页面 | ||
@@ -181,0 +188,0 @@ this.hot = hot; |
{ | ||
"name": "react-router-controller", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "react-router-controller,react路由控制器", | ||
@@ -5,0 +5,0 @@ "main": "libs/index.js", |
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
1002107
6329