Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 我无法执行loadMore,因为hasMore()始终返回false,即使hasNextPage为true?_Reactjs_Graphql_Relayjs_Relay - Fatal编程技术网

Reactjs 我无法执行loadMore,因为hasMore()始终返回false,即使hasNextPage为true?

Reactjs 我无法执行loadMore,因为hasMore()始终返回false,即使hasNextPage为true?,reactjs,graphql,relayjs,relay,Reactjs,Graphql,Relayjs,Relay,我不知道为什么我的loadMore不工作,这是我分页中的代码: todos(first: $count # count is default to 2 ) @connection(key: "TodoList_todos") { # edges { cursor node { id, complete, ...Todo_to

我不知道为什么我的loadMore不工作,这是我分页中的代码:

   todos(first: $count # count is default to 2
        ) @connection(key: "TodoList_todos") { #
          edges {
            cursor
            node {
              id,
              complete,
              ...Todo_todo,
            }
          }
           pageInfo {
              endCursor
              hasNextPage
              hasPreviousPage
              startCursor
           }

当hasNextPage返回true时,为什么我的hasMore返回false?我该如何解决这个问题

您正在设置getConnectionFromProps吗? 可能需要像道具一样

module.exports=createPaginationContainer 待办事项, { todos:graphql` todosfirst:$count默认为2 @connectionkey:TodoList_todos{ 边缘{ 光标 节点{ 身份证件 完成 …Todo_Todo, } } 页面信息{ 结束光标 下一页 上一页 startCursor } ` }, { 方向:“前进”, getConnectionFromProps:props=>props.todos, getFragmentVariables:vars,totalCount=>{ …vars, 计数:总计计数, }, getVariables:props,{count,cursor}=>{ 计数 光标 }, 环境:环境,, 查询:graphql` 查询TodosPaginationQuery$count:Int!,$cursor:String{ …商店名单 } ` } ;