Skip to content

Commit

Permalink
FastField: fallback to default shouldComponentUpdate implementation e…
Browse files Browse the repository at this point in the history
…ven if custom shouldUpdate implementation returns false (#1238) (#1317)
  • Loading branch information
Verbon authored and jaredpalmer committed Jun 22, 2019
1 parent 49b0706 commit 3f8d27d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FastField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class FastFieldInner<Values = {}, Props = {}> extends React.Component<
shouldComponentUpdate(
props: FastFieldAttributes<Props> & { formik: FormikContext<Values> }
) {
if (this.props.shouldUpdate) {
return this.props.shouldUpdate(props, this.props);
if (this.props.shouldUpdate && this.props.shouldUpdate(props, this.props)) {
return true;
} else if (
getIn(this.props.formik.values, this.props.name) !==
getIn(props.formik.values, this.props.name) ||
Expand Down

0 comments on commit 3f8d27d

Please sign in to comment.