-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
Add React.isFragment api for verifying Fragment #12038
Comments
Is there already some progress on this? If no, maybe I can take this |
There is #11279, which implements |
I'm going to take a look into finishing up PR #11279. |
Check out PR #12199 |
FYI you can test the new |
@bvaughn This package is awesome! |
Glad to hear! |
Closing, since this API exists in |
Do you want to request a feature or report a bug?
I want to request a feature.
What is the current behavior?
We have no API to verify a ReactNode is a React 16 Fragment. Though now we can use
React.isValidElement(instance) && typeof instance.type === 'symbol'
to distinguish it. It's verbose and seems uncertianly right.What is the expected behavior?
Add api:
Verifies the object is a React.Fragment. Returns true or false.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 16.2
The text was updated successfully, but these errors were encountered: