Supporting unwanted undefined in object
TommySorensen opened ·
Is there any plans for supporting this use case? ```js clsx({undefined: false}); ``` Will return `undefined` which is unwanted.
Im using clsx in a React.js solution with CSS Modules like this: ```js <section className={clsx( styles.test, { [styles[someOtherThing!]]: !!someOtherThing } )} > ``` In this case `someOtherThing` can be undefined or null and since i am doing `!!someOtherThing` then clsx should never return the "undefined" value.
- LU
It wouldn’t show up with false, so here !!someOtherThing is evaluating to true. And “undefined” is always a string when used as a key name. See #40 for more explanation — it’s native JS and is due to the `[undefined]: true` syntax