Skip to content

Commit

Permalink
fix(example): boolean flag for email check
Browse files Browse the repository at this point in the history
That prevents unnecessary rerenders from string modifications.
We don't care if the string changes, we care if it's falsey.
  • Loading branch information
soup-in-boots committed Apr 28, 2024
1 parent 18b0c7a commit 82305e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions example/data/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ export function form() {
const email = useValue(['email']);
const spamOption = useMemo(
() =>
email
!!email
? {
key: 'spam',
type: 'checkbox',
title: 'Yes I want spam.',
}
: null,
[email]
[!!email]
);
return useMemo(
() => [
Expand Down

0 comments on commit 82305e6

Please sign in to comment.