小编Şeh*_*eri的帖子

从我在 react-table 中发送请求的 api 中获取

我将需要一个服务器端表,所以在我react-table在 github 上看到9k+ 星后决定使用它,我正在尝试构建一个 React-Table,它可以轮询远程服务器的每个请求数据以获取最新数据。所以在示例中,我确实使用了 jsonplaceholder 我请求了数据 func 工作,它将获取我过滤的数据排序pageSizepageIndexhttps://jsonplaceholder.typicode.com/posts?_start={pageIndex will come here}&_limit={pageSize will come here}...排序和过滤的数据)我该怎么做?谢谢你。

下面我写了一些代码但没有很好的编码抱歉

//Table.js
import React, { useState, useEffect } from 'react';
import { useTable, useFilters, useSortBy, usePagination } from 'react-table';

export default function Table({ columns, data, pages, onFetchData, loading, pageCount: controlledPageCount, error }) {
    const [ filterInput, setFilterInput ] = useState('');
    // Use the state and functions returned from useTable to build your UI
    const {
        getTableProps,
        getTableBodyProps, …
Run Code Online (Sandbox Code Playgroud)

reactjs react-table react-hooks

9
推荐指数
1
解决办法
3351
查看次数

标签 统计

react-hooks ×1

react-table ×1

reactjs ×1