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

Bug: custom collider props are not reactive anymore. #149

Open
5 tasks done
Neosoulink opened this issue Nov 19, 2024 · 1 comment
Open
5 tasks done

Bug: custom collider props are not reactive anymore. #149

Neosoulink opened this issue Nov 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working collider Everything related to colliders

Comments

@Neosoulink
Copy link
Collaborator

Describe the bug

While working on the Joint I wanted to reproduce the same custom collider exportation, and when I wanted to watch the Joint props, I wasn't able to do so...

I figured that the Vue component setup function needs a Proxy as the first parameter to reflect changes and here:
https://github.com/Tresjs/rapier/blob/main/src/components/colliders/index.ts#L29-L42

props: {
      ...BaseCollider.props,
      shape: undefined,
    },
    setup(props, ctx) {
      return {
        ...BaseCollider?.setup?.(
          { ...props, shape } as Parameters<
            Exclude<(typeof BaseCollider)['setup'], undefined>
          >['0'],
          ctx,
        ),
      }
    },

We are destructing it which is equivalent to passing a native Object

Reproduction


Steps to reproduce


System Info

---

Used Package Manager

npm

Code of Conduct

@Neosoulink Neosoulink added bug Something isn't working collider Everything related to colliders labels Nov 19, 2024
@Neosoulink Neosoulink self-assigned this Nov 19, 2024
@Neosoulink
Copy link
Collaborator Author

I'm going to provide a fix asap @alvarosabu @JaimeTorrealba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working collider Everything related to colliders
Projects
None yet
Development

No branches or pull requests

1 participant