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

useTres().camera.value should always be defined #872

Open
4 tasks done
andretchen0 opened this issue Nov 27, 2024 · 0 comments
Open
4 tasks done

useTres().camera.value should always be defined #872

andretchen0 opened this issue Nov 27, 2024 · 0 comments
Labels
feature p3-significant High-priority enhancement (priority)

Comments

@andretchen0
Copy link
Contributor

Description

Typically, useTres().camera.value holds a camera. But the type includes undefined.

This leads to extra, otherwise unneeded reactivity and type checking.

Suggested solution

  • Define a dummy camera. If no user camera is currently defined, fall back on the dummy camera.
  • Remove undefined from the type.

Alternative

No response

Additional context

R3F defines a dummy camera so that the state always includes a camera.

Validations

@andretchen0 andretchen0 added feature p3-significant High-priority enhancement (priority) labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature p3-significant High-priority enhancement (priority)
Projects
Status: No status
Development

No branches or pull requests

1 participant