Skip to content

Implement react-use-measure #21

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Implement react-use-measure #21

wants to merge 3 commits into from

Conversation

koole
Copy link

@koole koole commented Jun 3, 2024

Resolves #20

Copy link

vercel bot commented Jun 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-three-offscreen ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 3, 2024 6:20pm

@afshawnlotfi
Copy link

Bumping this, still has the same issue

@afshawnlotfi
Copy link

afshawnlotfi commented May 5, 2025

Implemented fix on my end and it works but need to do it like this for when worker is undefined:

  useEffect(() => {
    if (!worker) return
    worker.postMessage({
      type: 'resize',
      payload: {
        width: bounds.width,
        height: bounds.height,
        top: bounds.top,
        left: bounds.left,
      },
    })
  }, [bounds, worker])

@afshawnlotfi
Copy link

After some testing with larger examples this solution causes slowdown, finding a better way.

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.

Component resizes are not watched, only complete window resizes have effect
2 participants