-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
[List, Edit, Create, Show] Wrap view components into styles HOC instead of wrapping main components #3161
Conversation
You're totally right, it makes more sense. Would you mind doing the same for Edit and List, so that all views are consistent? |
@@ -193,4 +193,4 @@ Show.propTypes = { | |||
title: PropTypes.any, | |||
}; | |||
|
|||
export default withStyles(styles)(Show); | |||
export default Show; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not make much sense to have both a named and a default export for the same object. Remove the named export (you will have to change the import in Show.spec.js, too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
Did the same for |
@fzaninotto I've managed to fix that by using Generally, I'm not a big fan of enzyme unit tests. They are tightly coupled with implementation details, which leads to false positives like this one. |
Awesome, thanks! |
When using
ShowController
andShowView
instead of singleShow
component,Show
styles aren't used anymore.This makes
aside
component appear under show view (when usingShow
component,aside
is on the right).Wrapping
ShowView
with styles HOC resolves the issue. Also, it makes more sense, since styles are related to view component, notShow
component, which is simply composition of controller and view.