Skip to content

Commit

Permalink
Fix the reinitialization of useEffect dependency when the component r…
Browse files Browse the repository at this point in the history
…e-renders. (#1514)
  • Loading branch information
usavkov-epam authored Sep 12, 2024
1 parent 3d3fc62 commit 97a3cf8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ const arePropsEqual = (prev, next) => {
);
};

const DEFAULT_REQUIRED_FIELDS = [DATE_TYPES.START, DATE_TYPES.END];

const TheComponent = ({
dateFormat = 'YYYY-MM-DD',
placement = 'right-start',
Expand All @@ -83,7 +85,7 @@ const TheComponent = ({
makeFilterString,
onChange,
focusRef,
requiredFields = [DATE_TYPES.START, DATE_TYPES.END],
requiredFields = DEFAULT_REQUIRED_FIELDS,
// accessible label for disambiguating this start input from others.
startLabel,
// accessible label for disambiguating this end input from others.
Expand Down

0 comments on commit 97a3cf8

Please sign in to comment.