Skip to content

Commit

Permalink
Use nullish coaelescing
Browse files Browse the repository at this point in the history
  • Loading branch information
wlee221 committed Dec 1, 2022
1 parent 9c97418 commit 45ca1e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function ChangePassword({

/* Subcomponents */
const { CurrentPassword, NewPassword, ConfirmPassword, SubmitButton, Error } =
React.useMemo(() => ({ ...DEFAULTS, ...(components || {}) }), [components]);
React.useMemo(() => ({ ...DEFAULTS, ...(components ?? {}) }), [components]);

/* Event Handlers */
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function DeleteUser({

// subcomponents
const { Error, SubmitButton, Warning } = React.useMemo(
() => ({ ...DEFAULTS, ...(components || {}) }),
() => ({ ...DEFAULTS, ...(components ?? {}) }),
[components]
);

Expand Down

0 comments on commit 45ca1e2

Please sign in to comment.