-
Notifications
You must be signed in to change notification settings - Fork 117
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
Warning: The <withAvatarConfig /> component appears to be a function component that returns a class instance. #171
Comments
Hi @dnizetic, Could you provide a codesandbox that is throwing this warning? |
Looks like I am on my own because in Sandbox with React 16.8.6 it doesn't throw the warning: https://codesandbox.io/embed/react-example-xgnnf Probably react-hot-loader may be interfering or something else. |
Hi @dnizetic, Did you ever find out what was causing this issue for you? |
I have the same issue and I am using react-hot-loader. If I remove that then it works fine. I haven't yet found a solution or put effort into it since it is only a warning in the dev environment. |
I have solved this issue in my environment but it maybe not a generic case. Let me tell the details here in case somebody would figure out what happens. I am using Gatsby and in dev environment (with hot reloading enabled) I always saw this warning in the console. However, at the same time, I had another warning message related to the following react-hot-loader issue in Gatsby: gatsbyjs/gatsby#11934. Following the suggestion from the bottom of this specific comment in that thread: gatsbyjs/gatsby#11934 (comment) fixed both issues simultaneously. |
I switched to a newer version of React - 16.8.6. After doing so Avatar started throwing this warning:
Warning: The <withAvatarConfig /> component appears to be a function component that returns a class instance. Change withAvatarConfig to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround.
withAvatarConfig.prototype = React.Component.prototype. Don't use an arrow function since it cannot be called with
newby React.
The text was updated successfully, but these errors were encountered: