-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
SFC detection: React 16 #1510
Comments
While looking at how to implement this here is some thoughts I had. Right now Example being the display name rule wanting to find this as a component and making it invalid because it doesn't have a display name. import React, { createElement } from "react";
export default (props) => {
return createElement("div", {}, "hello");
}; Right now the We might have to define what of those above rules are required to be a "maybe" component, update |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I think this is largely resolved; please open new issues if there's any further problems with SFC component detection. |
Prior to React 16, separate from what detection rules are actually in the code, an SFC conceptually meets the following static criteria:
null
props
andcontext
, destructured or otherwise)propTypes
,defaultProps
,contextTypes
,displayName
In React 16, components can also return strings, and/or arrays.
This issue is to track:
The text was updated successfully, but these errors were encountered: