Closed krutoo closed 10 months ago
@krutoo thanks for the report :)
I'll take a look.. Im just curious, whats exactly the usecase here? What do you expext the overflow
option to be when you specify it like this?
@KingSora this is consistent with the work of javascript, for example, when destructuring objects, you can assign a default value that will be applied regardless of whether the object has an undefined value or is not defined at all:
const source = { a: undefined };
const { a = 1, b = 2 } = source;
console.log(a, b) // 1 2
In my case i have component that passes a value to an internal component OverlayScrollbarsComponent:
function MyComponent ({ overflow }) {
return <OverlayScrollbarsComponent options={{ overflow }} />
}
Is optional prop, but MyComponent breaks when is not passed or passed as undefined
Describe the bug I use react version like this:
TypeScript types say that overflow is not required options so there is no type check errors
But when i render it then it fails with error:
To Reproduce Steps to reproduce the behavior:
Expected behavior undefined value should be interpreted as not provided overflow option i think