-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Tooltip Both Fix with Dynamic State #7288
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
@@ -14,6 +14,7 @@ export const Tooltip = React.memo( | |||
const [visibleState, setVisibleState] = React.useState(false); | |||
const [positionState, setPositionState] = React.useState(props.position || 'right'); | |||
const [classNameState, setClassNameState] = React.useState(''); | |||
const [multipleFocusEvents, setMultipleFocusEvents] = React.useState(false); |
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.
Actually you can switch this to a ref
it doesn't need to be useState
as its not used in any hooks you are just tracking a boolean state.
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.
I can update it but there is something I didn't understand help me if I'm missing something. I put boolean inside of state because I wanted trigger a boolean value with using ref
how can I achieve that?
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.
you jiust do yourRef.current = true
or false
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.
Yeap, I did the same but like I said we should trigger the component. You can try it in your local or I can commit.
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.
interesting i was not expecting that based on looking at this code. You are just using a boolean flag. Changing the state is not used by any hook?
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.
Thanks!
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.
@melloware you merged but there is prettier error what should I do?
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.
Oh I can fix it. Next time run npm run format
on the codebase it fixes it
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.
When will be the release date?
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.
@Luko248 that is up to PrimeTek I don't have any insight on release dates.
fixes #7260
before
Screen.Recording.2024-10-01.at.20.27.31.mov
after
Screen.Recording.2024-10-01.at.20.28.20.mov