@shopify/react-form-state
Advanced tools
Comparing version
@@ -7,2 +7,8 @@ # Changelog | ||
## [0.9.0] | ||
### Removed | ||
- `<Nested />` and `<List />`: removed logic in `shouldComponentUpdate()` limiting updates | ||
## [0.8.0] | ||
@@ -9,0 +15,0 @@ |
@@ -8,5 +8,4 @@ import * as React from 'react'; | ||
} | ||
export default class List<Fields> extends React.Component<Props<Fields>, never> { | ||
export default class List<Fields> extends React.PureComponent<Props<Fields>, never> { | ||
private changeHandlers; | ||
shouldComponentUpdate(nextProps: any): boolean; | ||
render(): JSX.Element[]; | ||
@@ -13,0 +12,0 @@ private handleChange; |
@@ -33,9 +33,2 @@ "use strict"; | ||
} | ||
List.prototype.shouldComponentUpdate = function (nextProps) { | ||
var _a = nextProps.field, nextValue = _a.value, nextError = _a.error, nextInitialValue = _a.initialValue; | ||
var _b = this.props.field, value = _b.value, error = _b.error, initialValue = _b.initialValue; | ||
return (nextValue !== value || | ||
nextError !== error || | ||
nextInitialValue !== initialValue); | ||
}; | ||
List.prototype.render = function () { | ||
@@ -64,3 +57,3 @@ var _this = this; | ||
return List; | ||
}(React.Component)); | ||
}(React.PureComponent)); | ||
exports.default = List; |
@@ -7,5 +7,4 @@ import * as React from 'react'; | ||
} | ||
export default class Nested<Fields> extends React.Component<Props<Fields>, never> { | ||
export default class Nested<Fields> extends React.PureComponent<Props<Fields>, never> { | ||
private changeHandlers; | ||
shouldComponentUpdate(nextProps: any): boolean; | ||
render(): React.ReactNode; | ||
@@ -12,0 +11,0 @@ private handleChange; |
@@ -29,9 +29,2 @@ "use strict"; | ||
} | ||
Nested.prototype.shouldComponentUpdate = function (nextProps) { | ||
var _a = nextProps.field, nextValue = _a.value, nextError = _a.error, nextInitialValue = _a.initialValue; | ||
var _b = this.props.field, value = _b.value, error = _b.error, initialValue = _b.initialValue; | ||
return (nextValue !== value || | ||
nextError !== error || | ||
nextInitialValue !== initialValue); | ||
}; | ||
Nested.prototype.render = function () { | ||
@@ -55,3 +48,3 @@ var _this = this; | ||
return Nested; | ||
}(React.Component)); | ||
}(React.PureComponent)); | ||
exports.default = Nested; |
{ | ||
"name": "@shopify/react-form-state", | ||
"version": "0.8.3", | ||
"version": "0.9.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Manage react forms tersely and type-safe with no magic.", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
177625
-1.89%3829
-2.64%