Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[preact/compact] Suppport react-is #3899

Open
clyfish opened this issue Feb 16, 2023 · 3 comments
Open

[preact/compact] Suppport react-is #3899

clyfish opened this issue Feb 16, 2023 · 3 comments

Comments

@clyfish
Copy link
Contributor

clyfish commented Feb 16, 2023

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'
@marvinhagemeister
Copy link
Member

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?

@clyfish
Copy link
Contributor Author

clyfish commented Feb 25, 2023

@marvinhagemeister antd and react-dnd depend on react-is, and more.

$ npm ls react-is
├─┬ antd@5.2.2
│ └─┬ rc-util@5.28.0
│   └── react-is@16.13.1
└─┬ react-dnd@16.0.1
  └─┬ hoist-non-react-statics@3.3.2
    └── react-is@16.13.1 deduped

@ziongh
Copy link
Contributor

ziongh commented Mar 13, 2024

Great that isFragment is implemented! But isMemo is not yet implemented, and that breaks the Antd (and other) packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants