-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Deprecate isValidClass #2374
Comments
So you know we put out an RC already, right? We really should have decided this before that happened. But sure, let's deprecate it. Want to put up that PR? |
Hi, sorry for comment on an old post. I have a question on your assertion. You mentioned that:
But, the function created by
So, basically, the current existing React Classes does not meet your criteria. :( Any idea on this? PS. Using |
Needed to update how we're doing some React stuff. The only thing that's not solved is the deprecation warning for `React.isValidClass`, following this issue facebook/react#2374 and not sure how we want to validate the `reactClass` function.
We should deprecate isValidClass. In 0.13, any function that returns an object with a render method will be a valid class.
We probably don't want to assume that there is a valid prototype because that doesn't allow the module pattern to be used:
It's really difficult to validate these without invoking them. This is where a static type system shines. For a dynamic check, isValidClass would turn into:
typeof fn === 'function'
which doesn't need its own function.Generally, you'll want to validate something extra about the class anyway. E.g. will it have a
getDOMNode
method on it? Does it render into a table cell?The text was updated successfully, but these errors were encountered: