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

Create useContentRect hook #273

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

leroykorterink
Copy link
Collaborator

No description provided.

@leroykorterink leroykorterink added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers labels Nov 24, 2023
@leroykorterink leroykorterink requested review from tworrisb and a team November 24, 2023 18:39
@leroykorterink leroykorterink self-assigned this Nov 24, 2023
@ThaNarie
Copy link
Member

I'm wondering why the state version of this hook uses a different implementation (raf), and why those two implementations can't use each-other or a shared function as a base :)

@leroykorterink
Copy link
Collaborator Author

I'm wondering why the state version of this hook uses a different implementation (raf), and why those two implementations can't use each-other or a shared function as a base :)

@ThaNarie for the ref version we don't have to use a request animation frame to keep everything running smoothly. The resize observer callback should update every frame, but doing state updates more often is not desirable.

@leroykorterink leroykorterink merged commit 605b659 into main Dec 1, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants