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

Update intent-button.md, use getInputProps #750

Closed
wants to merge 1 commit into from

Conversation

willhoney7
Copy link

@willhoney7 willhoney7 commented Aug 22, 2024

I was about to open up a bug report because I couldn't get the insert intent to work correctly when setting a defaultValue, but then I realized it's because the input needs to use getInputProps. I had copied from the example here, so here's a simple PR to update the example to use getInputProps.

update: The complex structures page should probably receive some edits as well. https://conform.guide/complex-structures

use getInputProps for the input to avoid issues when setting defaultValue
Copy link

changeset-bot bot commented Aug 22, 2024

⚠️ No Changeset found

Latest commit: d41b50b

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 Aug 22, 2024

commit: d41b50b

@conform-to/dom

pnpm add https://pkg.pr.new/@conform-to/dom@750

@conform-to/react

pnpm add https://pkg.pr.new/@conform-to/react@750

@conform-to/validitystate

pnpm add https://pkg.pr.new/@conform-to/validitystate@750

@conform-to/yup

pnpm add https://pkg.pr.new/@conform-to/yup@750

@conform-to/zod

pnpm add https://pkg.pr.new/@conform-to/zod@750

Open in Stackblitz

More templates

@edmundhung
Copy link
Owner

Hi @willhoney7, sorry for the confusion. If you need to be able to update a field, the minimal setup as of v1.1.5 would be <input key={task.key} name={task.name} defaultValue={task.initialValue} /> which is what getInputProps does for you.

Having said that, this is no longer true once #729 is landed, in which <input name={task.name} /> is enough as long as you don't care about full document reload (progressive enhancement).

There is a pre-release version in the PR above. Feel free to give it a try and let me know if you run into any problems.

I am likely gonna leave this unmerged so I don't need to revert it later. But I will keep the PR open until the change is landed. Thanks again for putting this up!

@edmundhung
Copy link
Owner

v1.2.0 is finally out. Sorry again for the confusing example there. I hope you like the new changes :)

@edmundhung edmundhung closed this Sep 14, 2024
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