Skip to content

<TresGroup> ref children don't update #1245

@vincerubinetti

Description

@vincerubinetti

Describe the bug

The value of a <TresGroup> ref does not update the number of children (and in general, probably doesn't reflect the latest state of the underlying Three Group object). But this only happens in specific circumstances. It seems to only happen when there is another element as a sibling to, but not a child of, the group. I can't narrow it down more than that at the moment.

Reproduction

https://stackblitz.com/edit/tresjs-minimal-reproduction-gp2hknji?file=package.json

Steps to reproduce

  • Look at the minimal reproduction.
  • Run with npm run dev if needed.
  • Open the console.
  • Observe that boxes are being added to the scene.
  • Observe that the console is logging 0 for boxesRef.value?.children.length.
  • Remove/comment out the <TresGridHelper> element.
  • Observe that the console now correctly shows the number of children going up.

System Info

  • Chrome
  • Bun as package manager (irrelevant, happens in minimal reproduction)
  • Windows 10 (irrelevant, happens in minimal reproduction)
  • Astro (irrelevant, happens in minimal reproduction)
{
  "dependencies": {
    "@astrojs/vue": "^5.1.3",
    "@tresjs/core": "^5.2.0",
    "astro": "^5.16.4",
    "three": "^0.182.0",
    "vue": "^3.5.25",
  },
}

Used Package Manager

npm

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions