Skip to content

docs: fix docs on mutating props #14079

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

Merged
merged 1 commit into from
Oct 31, 2024
Merged

docs: fix docs on mutating props #14079

merged 1 commit into from
Oct 31, 2024

Conversation

Rich-Harris
Copy link
Member

The docs added in #13994 are helpful but also somewhat misleading: the message should be a loud and clear 'don't mutate props' followed by details and examples, rather than an illustration of mutating a prop that does work but without mentioning the warning that happens when you do.

There were also some errors in the code snippets, which is really a consequence of a) the fact that we have to manually keep snippets and playground links in sync, and b) the fact that we don't have typechecking of .svelte snippets (which would have caught the object = { count = 0 } syntax error, for example). We should fix both of those.

Copy link

changeset-bot bot commented Oct 31, 2024

⚠️ No Changeset found

Latest commit: 9429d27

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

pkg-pr-new bot commented Oct 31, 2024

pnpm add https://pkg.pr.new/svelte@14079

commit: 9429d27

@Rich-Harris Rich-Harris merged commit 9cd4768 into main Oct 31, 2024
10 checks passed
@Rich-Harris Rich-Harris deleted the fix-props-docs branch October 31, 2024 18:36
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 this pull request may close these issues.

2 participants