小编Sri*_*a K的帖子

如何使用 react-table 实现服务器端分页?

我是反应表的新手。我正在尝试实现服务器端分页,但我没有获得有关如何检测新 react-table 版本中页面更改的逻辑。我正在正确使用获取数据我无法检测到更改。每次单击“下一步”按钮时,我都应该能够以 20 为增量更改 API 端点中的偏移值以获取新数据。我无法执行此操作。请帮忙。

import React, { useEffect, useState, useMemo } from 'react'
import { URLs } from "../../../Config/url";
import cookie from 'react-cookies';
import "./OrderManagementScreen.css"
import { useTable, usePagination, useSortBy } from 'react-table';
import styled from 'styled-components';


const Styles = styled.div`
padding: 1rem;

table {
  border-spacing: 0;
  border: 1px solid lightgray;
  width: 100%;
  text-align: "center" !important;

  tr {
    :last-child {
      td {
        border-bottom: 0;
        text-align: "center" !important;
      }
    }
  }
  th {
    padding: 3px;
    box-shadow: 0px 5px …
Run Code Online (Sandbox Code Playgroud)

javascript async-await reactjs react-table react-hooks

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

在 React Native 中安排本地通知不起作用

我正在使用react-native-push-notificationsnpm 库在我的应用程序中实现通知功能。但是,我想安排通知,我正在使用它PushNotification.localNotificationSchedule。但不知何故,当我试图触发时它不起作用。我已经粘贴了下面的代码。有人可以帮我解决这个问题我是这个功能的新手。

事件处理程序

const testPush = () =>{
      PushNotification.localNotificationSchedule({
        title:'My notification title',
        date:new Date(new Date().getTime()+3000),
        message:'My notification Message',
        allowWhileIdle:false
      });
    }
Run Code Online (Sandbox Code Playgroud)

事件触发器

      <Pressable
        onPress={testPush}
        style={{ marginTop: 13 }}
      >
        <View style={{ backgroundColor: '#20232a', padding: 13, alignItems: 'center', borderRadius: 10 }}>
          <Text style={{ color: '#ffffff' }}>Test push</Text>
        </View>
      </Pressable>
Run Code Online (Sandbox Code Playgroud)

javascript push-notification npm react-native react-native-push-notification

2
推荐指数
1
解决办法
3851
查看次数