React Apollo 2 with React Router. graphql HOC load

2019-05-11 12:07发布

问题:

This is the code: https://codesandbox.io/s/p90q6674qq

I simply use:

export default graphql(CURRENT_USER_QUERY)(Menu);

on the Menu component and simply this code in App component:

class App extends Component {
  render() {
    return (
      <div>
        {/* <Menu /> */}
        <Route component={Menu} />
        <Route exact path="/" component={Home} />
        <Route path="/login" component={Login} />
      </div>
    );
  }
}

A bug?

Where am I wrong?