When I try to compose withApollo() I get
graphql.js:37 Uncaught TypeError: Cannot read property 'displayName' of undefined
In getDisplayName function
function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
}
This does not work
export default compose(
withApollo(),
translate(),
graphql(GET_SALON, {
options: ownProps => ({
variables: { slug: ownProps.params.slug },
}),
}),
)(Salon)
This works
export default compose(
translate(),
graphql(GET_SALON, {
options: ownProps => ({
variables: { slug: ownProps.params.slug },
}),
}),
)(withApollo(Salon))
Version
My 2cent, shouldn't it be
export default compose(
withApollo, //no () after "withApollo"
translate(),
graphql(GET_SALON, {
options: ownProps => ({
variables: { slug: ownProps.params.slug },
}),
}),
)(Salon)
?
@svrcekmichal you're right, thanks! Stupid mistake ...
Most helpful comment
My 2cent, shouldn't it be
?