-
-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve QueryEditor flow #844
Conversation
Your Render PR Server URL is https://toolpad-pr-844.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cc2gqfqrrk0fs3nnf0mg. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
export default function useBoolean(initialValue: boolean) { | ||
const [value, setValue] = React.useState(initialValue); | ||
const toggle = React.useCallback(() => setValue((existing) => !!existing), []); | ||
const set = React.useCallback(() => setValue(true), []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we plan to reuse this hook a lot maybe the names of the props could be a bit more intuitive?
maybe even something like setTrue
or setFalse
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set/reset is quite common nomenclature in boolean logic, but I have no strong feelings about it, I renamed it to setTrue
/setFalse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i hadn't heard about it, not a big deal. thanks for the change though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's more common in electronic circuits 🙂
Closes #798