[v11.2.x] UI/AutoSizeInput: Fixes issue where controlledValue being null caused crash (#94089)
UI/AutoSizeInput: Fixes issue where controlledValue being null caused crash (#94078)
(cherry picked from commit 1b82595251)
Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
This commit is contained in:
co-authored by
kay delaney
parent
f61a60f54b
commit
c9170b1435
@@ -32,7 +32,7 @@ export const AutoSizeInput = React.forwardRef<HTMLInputElement, Props>((props, r
|
||||
|
||||
// Update internal state when controlled `value` prop changes
|
||||
useEffect(() => {
|
||||
if (controlledValue !== undefined) {
|
||||
if (controlledValue) {
|
||||
setValue(controlledValue);
|
||||
}
|
||||
}, [controlledValue]);
|
||||
|
||||
Reference in New Issue
Block a user