Skip to content

Conversation

ryantrem
Copy link
Member

This changes BoundProperty to remove the conditional hooks (see https://react.dev/reference/rules/rules-of-hooks). The strategy here is to first do a useProperty in the "outer" component so we can observe the value of that property to determine if we really ideally should be using a more specific property hook that watches nested properties like x/y/z of a Vector3 for example. The desired hook is then used as the dependency for a useMemo that creates and returns an "inner" component that uses the desired hook. This eliminates conditional hooks.

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 19, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 19, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 19, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17041/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 19, 2025

Building or testing the playground has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17041/merge/testResults/

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 19, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 19, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 20, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 20, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 20, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17041/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17041/merge/?snapshot=refs/pull/17041/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 20, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 20, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Aug 20, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17041/merge/

@ryantrem ryantrem enabled auto-merge (squash) August 20, 2025 21:14
@ryantrem ryantrem merged commit a6add41 into BabylonJS:master Aug 21, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants