-
Notifications
You must be signed in to change notification settings - Fork 63
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
useControlledValue updates [LG-3608] #1953
Conversation
🦋 Changeset detectedLatest commit: 799a672 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +490 B (0%) Total Size: 1.14 MB
ℹ️ View Unchanged
|
expect(current.value).toBe('apple'); | ||
}); | ||
|
||
test('rerendering from initial undefined sets value and isControlled', async () => { |
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.
Do we want this case to log an error?
Closing for now and will reopen after #1951 is finished |
✍️ Proposed changes
useControlledValue
to accept any type.initialValue
argument. Used for setting the initial value for uncontrolled components. Without this we may encounter a React error for switching between controlled/uncontrolled inputsonChange
argument to be a simple setter function ((value: T) => void
)isControlled
,value
and anupdateValue
setter function🧪 How to test changes
See spec file