-
Notifications
You must be signed in to change notification settings - Fork 49
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
Cannot read property 'name' of null #66
Comments
I'm running into this issue to. I believe it has to do with exporting and anonymous functions. I've just flipped the plugin of for any file I do this in. It would be great to have another work around. Edit |
Can you provide a more minimal example which shows this behavior? Ideally, it would be a test case similar to what we have in |
I can reproduce this (or rather, a similar error) and will fix soon. |
Any function containing a react component is considered a functional React component by isFunctionalReactComponent(). This leads to false positives for functions which just use or generate instances of React components. These factory functions do not follow the general contract of react components. In particular, the first argument to the function may not be props. It is hard to detect these cases in isFunctionalReactComponent. Instead, we relax the sanity check in getPropsForTypeAnnotation: if a typeAnnotation exists but does not have the type we expect, we do not fail hard. We just don't generate proptypes.
* Fix issue #66 Any function containing a react component is considered a functional React component by isFunctionalReactComponent(). This leads to false positives for functions which just use or generate instances of React components. These factory functions do not follow the general contract of react components. In particular, the first argument to the function may not be props. It is hard to detect these cases in isFunctionalReactComponent. Instead, we relax the sanity check in getPropsForTypeAnnotation: if a typeAnnotation exists but does not have the type we expect, we do not fail hard. We just don't generate proptypes. * Add missing changelog for 3.1.2 * Add changelog entry for #66
Fixed in #99, published as 3.1.3. |
* Fix issue brigand#66 Any function containing a react component is considered a functional React component by isFunctionalReactComponent(). This leads to false positives for functions which just use or generate instances of React components. These factory functions do not follow the general contract of react components. In particular, the first argument to the function may not be props. It is hard to detect these cases in isFunctionalReactComponent. Instead, we relax the sanity check in getPropsForTypeAnnotation: if a typeAnnotation exists but does not have the type we expect, we do not fail hard. We just don't generate proptypes. * Add missing changelog for 3.1.2 * Add changelog entry for brigand#66
I have the following error with 0.20.0 (which was not present with 0.10.1
Here is the file (it's not a react components, but I babelify an entire folder)
The text was updated successfully, but these errors were encountered: