Skip to content

Commit 54fbfde

Browse files
committed
Release 0.16.14
1 parent 1e350ec commit 54fbfde

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-form-controlled",
3-
"version": "0.16.13",
3+
"version": "0.16.14",
44
"description": "React controlled form components. The main idea is to make forms as simple as possible.",
55
"author": {
66
"name": "Zlatko Fedor",

src/Element.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ export default class Element extends Component {
3131
});
3232
}
3333

34-
shouldComponentUpdate(nextProps, nextState, nextContext, ignore = []) {
34+
shouldComponentUpdate(nextProps, nextState, nextContext, ignoreProps = [], ignoreState = ignoreProps) {
3535
const { props, state } = this;
3636

37-
if (!shallowCompare(props, nextProps, ['value', ...ignore])) {
37+
if (!shallowCompare(props, nextProps, ['value', ...ignoreProps])) {
3838
return true;
3939
}
4040

41-
if (!shallowCompare(state, nextState, ignore)) {
41+
if (!shallowCompare(state, nextState, ignoreState)) {
4242
return true;
4343
}
4444

src/Select.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ export default class Select extends Element {
2929
this.setState(this.prepareState(newProps));
3030
}
3131

32+
shouldComponentUpdate(nextProps, nextState, nextContext) {
33+
return super.shouldComponentUpdate(
34+
nextProps,
35+
nextState,
36+
nextContext,
37+
[],
38+
['values', 'options']);
39+
}
40+
3241
prepareState(props) {
3342
const selectOptions = [];
3443
const { options, placeholder, value } = props;

0 commit comments

Comments
 (0)