-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
1760773
to
27f3be5
Compare
80dd1ee
to
dcc9cf5
Compare
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.
PR seems fine, but I must admit I don't immediately understand the use-case for this label / callback props thing. Can you point me to an example where we need this?
4347089
to
df7592e
Compare
@timbotnik Great question. We're not using an actual That being said; this makes way more sense when we have a This left me with a few choices:
|
@timbotnik This also made me realize the storybook story was using the wrong prop name so the |
0c18156
to
9e5b9a8
Compare
9e5b9a8
to
6fb2692
Compare
Co-authored-by: timbotnik <tim@apollographql.com>
6fb2692
to
af92079
Compare
@timbotnik I re-requested a review because I added a few more commits, specifically one to trickily add |
🚀 PR was released in |
Release Notes
The
Select
component needed to be refactored and this will include breaking API changes.Remove
label
prop fromSelect
We had a
label
prop before to indicate what to populate the select with when there was no content;select
s already have this logic by giving an option with an empty value:<option value="">empty text here</option>
Rename
defaultValue
toinitialValue
to be more inline with other non-controlled React elementsAdd
triggerAs
prop and remove passthroughclassName
to remove confusion as to where a top-levelclassName
would be usedAdd
labelPropsCallbackRef
prop.This is the magic of this PR. This will be called with an object of props to be spread onto your
<label>
component. It is called intelligently as to prevent infinite re-renders.Ensure this behaves correctly with
formik
by adding initial unit testing to actually useformik
. This exposed the issue that we don't provide anyonBlur
callback, which I added here as well.📦 Published PR as canary version:
8.3.2-canary.279.6749.0
✨ Test out this PR locally via:
npm install @apollo/space-kit@8.3.2-canary.279.6749.0 # or yarn add @apollo/space-kit@8.3.2-canary.279.6749.0