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

Tabs causes state_unsafe_mutation when value unset #53

Closed
hmnd opened this issue Feb 7, 2025 · 1 comment · Fixed by #87
Closed

Tabs causes state_unsafe_mutation when value unset #53

hmnd opened this issue Feb 7, 2025 · 1 comment · Fixed by #87

Comments

@hmnd
Copy link
Contributor

hmnd commented Feb 7, 2025

Repro: https://svelte.dev/playground/f4d4b324abe742f7b0fea4d087ddb22e?version=5.19.9

When the tabs are defined as $state instead of a const, the Tabs builder causes a state_unsafe_mutation error. This is happening because the value gets set within getTrigger/getContent if value is yet undefined.

@xiadnoring
Copy link

Hello.
Try to set default value

const tabs = new Tabs({"value": "Tab 1"})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants