preact
preact copied to clipboard
[preact/compact] Suppport react-is
Describe the feature you'd love to see
Some libraries use react-is
to check types of react element.
Will @preact/compat
support react-is
?
Additional context (optional)
https://www.npmjs.com/package/react-is
// for example
import { isMemo, isFragment } from 'react-is'
It's very unlikely that we'll ever support react-is
. It relies on very react specific internals that no other third party library needs. If there is a need for something like react-is
we'd rather add another entry to our package so that react-is
can be aliased to that.
So far we haven't come across libraries checking for the type of react element. Can you share the ones you found?
@marvinhagemeister antd and react-dnd depend on react-is, and more.
$ npm ls react-is
├─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
└─┬ [email protected]
└── [email protected] deduped
Great that isFragment
is implemented! But isMemo
is not yet implemented, and that breaks the Antd (and other) packages.