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

docs: Reverse recommendation for controlled inputs #1089

Merged
merged 4 commits into from
Jul 4, 2024

Conversation

rschristian
Copy link
Member

Reverses the recommendation for uncontrolled components over controlled, which I think everyone's in agreement with?

Do we want to also make a note of the issues that exist for controlled inputs in X?

@JoviDeCroock
Copy link
Member

Controlled components don't really exist in Preact, issues are things where you bail out of rendering resulting in the same value.

@rschristian
Copy link
Member Author

rschristian commented Mar 28, 2024

That was sorta my point, though I was trying to be a tad less bleak.

Do we want to out-right say they're unsupported? Problem is that a fair number of React folks expect that as a table-stakes feature, and for certain use cases (or if you squint hard enough at others), Preact can get the job done without them. A lot of users just assume they need them (which is a separate problem).

I just worry that being that up front about it might scare people away unnecessarily.

Edit: That being said, I'm happy to alter this to whatever. Just my 2 cents.

@JoviDeCroock
Copy link
Member

Yes, no I agree with you. I guess we could be upfront about returning to the same input and how to work around that (i.e. use an object-state or what's said here at the end)

@rschristian
Copy link
Member Author

I think that's reasonable.

Alrighty, I'll work on rewording this block entirely, get a bit more actionable info in here.

@rschristian rschristian marked this pull request as draft March 28, 2024 08:09
@rschristian rschristian force-pushed the docs/controlled-uncontrolled-inputs branch 2 times, most recently from 9df27c3 to 83022b7 Compare July 3, 2024 21:39
Comment on lines -84 to +85
<a class="repl-link" href={`/repl?code=${encodeURIComponent(source)}`}>
<a class="repl-link" href={`/repl?code=${encodeURIComponent(textToBase64(source))}`}>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, unrelated but missed in #1162 as we for some reason weren't calling btoa on this. Grep didn't find any other btoa references so I assumed we were all covered.

@rschristian rschristian marked this pull request as ready for review July 3, 2024 22:12
@rschristian
Copy link
Member Author

@JoviDeCroock I ended up re-using your example as you suggested, let me know if you disagree with any of the language or the reference to your blog post. I thought it could be useful, but perhaps it's too much context? Not sure.

@rschristian rschristian merged commit ff48305 into master Jul 4, 2024
5 checks passed
@rschristian rschristian deleted the docs/controlled-uncontrolled-inputs branch July 4, 2024 16:55
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.

4 participants