-
Notifications
You must be signed in to change notification settings - Fork 35
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
✨ Generic RepoFinder component #144
Conversation
components/repo/Finder.tsx
Outdated
) : ( | ||
items.map((item) => ( | ||
<Combobox.Option | ||
key={item.handle} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works just fine, but item.did
may be a more natural identifier to use.
onChange={(item) => { | ||
setSelectedItem(item) | ||
onChange(item) | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a little complicated to have both internal state and external state working at the same time, as it means consumers may be prone to get out of sync with the internal state of the component. Would it be awkward to make Finder
a standard controlled form component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surely doable but only issue is that in a lot of places, we use uncontrolled inputs and then utilize web native html form methods to get data. I like that pattern for the most part and only use controlled method when absolutely needed so I left the default behavior to match that.
will do a refactor if we end up seeing issues with this.
Your Render PR Server URL is https://ozone-staging-pr-144.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cq36kgeehbks73d81u60. |
Your Render PR Server URL is https://ozone-sandbox-pr-144.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cq36kguehbks73d81udg. |
Add a generic RepoFinder input field that searches by handle/did and shows profile details