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

feat(tree-view)!: rename children prop to nodes for Svelte 5 compatibility #2014

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

metonym
Copy link
Collaborator

@metonym metonym commented Oct 20, 2024

Fixes #2013

TreeView silently fails when using it with Svelte 5 because the children prop is reserved.

To fix this, rename the children prop to nodes. Additionally, rename the children property on nodes to nodes. This is to avoid confusion, but it's also necessary since TreeViewNodeList is a recursive component (i.e., passes props to svelte:self).

This is a breaking change but should be relatively straightforward to adapt to.

<TreeView
- children={[
+ nodes={[
    {
      nodes: [
        {
          id: 2,
          text: "IBM Analytics Engine",
-         children: [
+         nodes: [
            { id: 3, text: "Apache Spark" },
            { id: 4, text: "Hadoop" },
          ],
        },
      ],
    },
  ]}
/>

@metonym metonym force-pushed the treeview-children-prop-rename branch from 4bf67e7 to faa5631 Compare November 9, 2024 22:47
@metonym metonym force-pushed the treeview-children-prop-rename branch from faa5631 to 39e66a9 Compare November 9, 2024 22:49
@metonym metonym merged commit efddbbd into master Nov 9, 2024
3 checks passed
@metonym metonym deleted the treeview-children-prop-rename branch November 9, 2024 22:53
@metonym
Copy link
Collaborator Author

metonym commented Nov 20, 2024

Released in v0.86.0

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.

[Svelte 5] children prop is reserved
1 participant