In my react component + recompose I am trying to load a graphql dynamically depending on some props but if I use withProps the data is always undefined. I don't understand how to connect the withProps function with the branch in order to wait for the data to load.
My component:
`export const SimplePage = ({match, route, data: { post } }) => (
...
)
const enhance = compose(
withProps(props => graphql(resolveQuery(props.match.params))),
showApolloError(),
showSpinnerWhileApolloLoading()
)`
In this case data is always undefined. If I don't use withProps the query works fine (but I cannot pass props in order to load different queries).
Any ideas of how to approach this without duplicating the component? Thanks!