React Apollo 2 with React Router. graphql HOC loading: true forever if I navigate

微笑、不失礼 提交于 2020-01-13 13:11:28

问题


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?

来源:https://stackoverflow.com/questions/47733633/react-apollo-2-with-react-router-graphql-hoc-loading-true-forever-if-i-navigat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!