diff --git a/packages/hooks/src/useControllableValue/index.ts b/packages/hooks/src/useControllableValue/index.ts index f9e7759990..eb656966c8 100644 --- a/packages/hooks/src/useControllableValue/index.ts +++ b/packages/hooks/src/useControllableValue/index.ts @@ -35,13 +35,13 @@ function useControllableValue(props: Props = {}, options: Options = } = options; const value = props[valuePropName] as T; - const isControlled = props.hasOwnProperty(valuePropName); + const isControlled = Object.prototype.hasOwnProperty.call(props, valuePropName); const initialValue = useMemo(() => { if (isControlled) { return value; } - if (props.hasOwnProperty(defaultValuePropName)) { + if (Object.prototype.hasOwnProperty.call(props, defaultValuePropName)) { return props[defaultValuePropName]; } return defaultValue;