ant-design/components/_util/isPrimitive.ts
ice fbb11f0a38
fix(dropdown): support ReactNode type value (#50174)
* fix(dropdown): support ReactNode type value

* refactor: ternary operation

* fix: isPrimitive

* [CodeFactor] Apply fixes to commit 5c307e6

[ci skip] [skip ci]

---------

Signed-off-by: afc163 <afc163@gmail.com>
Co-authored-by: codefactor-io <support@codefactor.io>
Co-authored-by: afc163 <afc163@gmail.com>
2024-12-14 23:17:52 +08:00

4 lines
147 B
TypeScript

const isPrimitive = (value: unknown) => (typeof value !== 'object' && typeof value !== 'function') || value === null;
export default isPrimitive;