react-jss
Advanced tools
Comparing version 8.3.3 to 8.3.4
@@ -0,1 +1,6 @@ | ||
## 8.3.4 / 2018-03-13 | ||
- Allow updating Jss instance of JssProvider | ||
- Update JSS dependency to v9.7.0 | ||
## 8.3.3 / 2018-02-12 | ||
@@ -2,0 +7,0 @@ |
@@ -219,3 +219,4 @@ 'use strict'; | ||
key: 'componentWillReceiveProps', | ||
value: function componentWillReceiveProps(nextProps) { | ||
value: function componentWillReceiveProps(nextProps, nextContext) { | ||
this.context = nextContext; | ||
var dynamicSheet = this.state.dynamicSheet; | ||
@@ -222,0 +223,0 @@ |
'use strict'; | ||
var _templateObject = _taggedTemplateLiteral(['\n .a-id {\n right: 2px;\n }\n '], ['\n .a-id {\n right: 2px;\n }\n ']); | ||
var _expect = require('expect.js'); | ||
@@ -13,2 +15,4 @@ | ||
var _commonTags = require('common-tags'); | ||
var _getDisplayName = require('./getDisplayName'); | ||
@@ -26,3 +30,3 @@ | ||
/* eslint-disable global-require, react/prop-types, no-underscore-dangle */ | ||
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } /* eslint-disable global-require, react/prop-types, no-underscore-dangle */ | ||
@@ -349,2 +353,37 @@ describe('injectSheet', function () { | ||
}); | ||
describe('rerender with a new JSS instance when using a ThemeProvider', function () { | ||
it('should correctly render with a new JSS instance', function () { | ||
var ComponentA = injectSheet(function () { | ||
return { a: { left: '2px' } }; | ||
})(); | ||
var ComponentB = function ComponentB(_ref2) { | ||
var localJss = _ref2.localJss; | ||
return _react2['default'].createElement( | ||
JssProvider, | ||
{ jss: localJss }, | ||
_react2['default'].createElement( | ||
ThemeProvider, | ||
{ theme: {} }, | ||
_react2['default'].createElement(ComponentA, null) | ||
) | ||
); | ||
}; | ||
render(_react2['default'].createElement(ComponentB, { localJss: jss }), node); | ||
var newJss = createJss({ | ||
createGenerateClassName: _helper.createGenerateClassName, | ||
plugins: [{ | ||
onProcessStyle: function onProcessStyle() { | ||
return { right: '2px' }; | ||
} | ||
}] | ||
}); | ||
render(_react2['default'].createElement(ComponentB, { localJss: newJss }), node); | ||
var style = document.querySelectorAll('style')[0]; | ||
(0, _expect2['default'])(style.innerText.trim()).to.be((0, _commonTags.stripIndent)(_templateObject)); | ||
}); | ||
}); | ||
}); |
{ | ||
"name": "react-jss", | ||
"version": "8.3.3", | ||
"version": "8.3.4", | ||
"description": "JSS integration with React", | ||
@@ -88,3 +88,3 @@ "main": "lib/index.js", | ||
"hoist-non-react-statics": "^2.3.1", | ||
"jss": "^9.3.2", | ||
"jss": "^9.7.0", | ||
"jss-preset-default": "^4.3.0", | ||
@@ -91,0 +91,0 @@ "prop-types": "^15.6.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1103625
23
7254
Updatedjss@^9.7.0