edmundhung / conform

A type-safe form validation library utilizing web fundamentals to progressively enhance HTML Forms with full support for server frameworks like Remix and Next.js.
https://conform.guide
MIT License
1.8k stars 101 forks source link

Optimize Shadn Switch Component example by Using control.value #721

Closed reborn2135 closed 1 month ago

reborn2135 commented 1 month ago

Summary

This PR optimizes the Switch component in the shadcn example by replacing meta.value with control.value. This change aims to improve performance by reducing unnecessary re-renders.

Changes Made

Updated the Switch component to use control.value instead of meta.value Modified the relevant code snippet as follows:

Copy// Before
checked={meta.value === "on"}

// After
checked={control.value === "on"}
changeset-bot[bot] commented 1 month ago

⚠️ No Changeset found

Latest commit: 41cedcd309544eabd8395555964113e553e8be94

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