Skip to content
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

Fix example React code #16

Closed
wants to merge 1 commit into from
Closed

Conversation

Daniel15
Copy link

@Daniel15 Daniel15 commented Jan 2, 2021

Refs should use useRef, not useState.

@FezVrasta
Copy link
Member

No, react-popper works with states

@FezVrasta FezVrasta closed this Jan 2, 2021
@Daniel15
Copy link
Author

Daniel15 commented Jan 2, 2021

@FezVrasta The current example code isn't accepted by TypeScript. You shouldn't pass a setter method to a ref; you should only pass a ref obtained from useRef. The current approach is not the 'React way' to do things.

@FezVrasta
Copy link
Member

TS is wrong

@FezVrasta
Copy link
Member

More info floating-ui/react-popper#241 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants