Closed edmundhung closed 1 month ago
Latest commit: 3f72eba6ba894a916ffe938294583f83b5d2a970
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.
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
Latest commit: |
3f72eba
|
Status: | ✅ Deploy successful! |
Preview URL: | https://d2c9f96f.conform.pages.dev |
Branch Preview URL: | https://field-side-effect.conform.pages.dev |
Superseded by #729
Fix #600.
This is an attempt to remove the need of passing the
key
to each input manually by updating the fields value automatically. It means:getInputProps()
,getSelectProps()
orgetTextareaProps()
as it will no longer include akey
.name
will become the only metadata required to be set on your inputs. TheinitalValue
is required only if you care about progressive enhancement.The main challenge of this change is that Conform will trigger a re-render only when the subscribed metadata is changed and so we don't have a single place that will always re-render and runs the side effect we need. This PR resolves it by running the side effect everywhere we made a subscription and update the relevant fields only if the
initialValue
is subscribed.