腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(29)
视频
沙龙
1
回答
DeferFn
与
PromiseFn
react-async
、
如果我从
react-async
在异步组件中添加一个dropdown-textfield,然后添加一个当输入为changed.Do时触发的事件,我需要将该函数添加到
deferFn
或
promiseFn
,以确保每当我获取
浏览 13
提问于2020-01-19
得票数 1
1
回答
如何用useAsync定义TypeScript (反作用异步钩子)?
、
、
我正在使用React异步钩子来获取React组件中的API数据。fetchPopularProducts()是使用fetch进行api调用的异步方法:limit = 10,): Promise<Response<PopularProduct[]>> { const apiUrl = `${API_BASE_URL}/rest/V1/fa
浏览 5
提问于2022-05-23
得票数 2
1
回答
如何使用useAsync钩子向组件追加数据?
、
、
我使用
react-async
从api中获取数据,如下所示: const { data, error, isLoading } = useAsync({
promiseFn
: getOrders })应该是这样的: import {useAsync} from '
react-async
'
浏览 14
提问于2019-07-29
得票数 3
回答已采纳
1
回答
在useFetch上使用GET请求稍后运行异步调用
、
、
、
、
import React, {useEffect} from 'react'; const Example = (props
浏览 21
提问于2020-05-01
得票数 1
回答已采纳
2
回答
如何在url中id更改时重新呈现功能组件
、
、
、
useState} from 'react';import { useAsync } from '
react-async
default function (props) { const {data, error, isLoading} = useAsync({
promiseFn
浏览 10
提问于2020-04-24
得票数 1
回答已采纳
2
回答
'ImageSourcePropType‘类型上不存在属性'uri’
、
、
import React from 'react';import {
PromiseFn
, useAsync } from '
react-async
'; width: number;}; },
浏览 6
提问于2020-09-18
得票数 4
回答已采纳
1
回答
react异步诉8.0.0 -使用新的承诺支持w/ Typescript和乐观更新
const { data: result, run, setData, promise } = useAsync({
deferFn
: postPhoto
浏览 0
提问于2019-08-27
得票数 0
回答已采纳
4
回答
那是什么类型的组件初始化?
、
import React from "react" fetch('https://jsonplaceholder.typicode.comres : Promise.reject(res))) <Async
promiseFn
={loadPost
浏览 0
提问于2019-12-30
得票数 2
1
回答
数据不会被拉进前端--反应
代码:// async {
promiseFn
浏览 2
提问于2020-09-25
得票数 0
回答已采纳
3
回答
如何重构处理太多条件/用例的react组件?
、
、
、
、
我想应用坚实的原则
与
反应组件,这是处理太多的‘用例’。
浏览 3
提问于2020-07-20
得票数 3
回答已采纳
1
回答
使用React组织/管理多个模态的“正确”方式
、
、
, { useState } from 'react'import { useAsync } from '
react-async
// Retrieve the budgeting data
promiseFn
: budgetApi.getPromise,
浏览 8
提问于2021-05-14
得票数 1
回答已采纳
2
回答
将许多(>40,000)本地承诺链接在一起消耗了太多的内存。
、
、
function promiseEach(array,
promiseFn
){ try {counter: 0 } promiseArray.push(
promiseFn
浏览 0
提问于2016-10-27
得票数 0
回答已采纳
1
回答
类型标嵌套函数包装返回类型问题
、
、
、
type
PromiseFn
= (...args: any[]) => Promise<any>;} predicate: ThrottlerPredicate,
浏览 9
提问于2022-03-23
得票数 2
回答已采纳
1
回答
如何在播放列表中使用ReactHowler
、
、
、
import React, { useState } from 'react';import Async from '
react-async
className="music"> <Async
promiseFn
浏览 1
提问于2020-08-09
得票数 0
回答已采纳
2
回答
如何实现重复的承诺调用链?
、
请知道,我并不是在寻找简化模式,因为它假设我已经需要事先知道执行的次数。这里的递归度也过高了。let response_that_will_come_from_each_promise = null; response_that_will_come_from_each_promise = execute_my_call_that_is_a_promise(); } while(!('finished_all_calls' in response_that
浏览 0
提问于2019-08-14
得票数 0
回答已采纳
2
回答
如何使计数器按钮在页面重新加载后保持不变
、
/App.css'; .then(res => res.json()) const { data, isLoading } = useAsync({
promiseFn
浏览 18
提问于2021-07-30
得票数 2
回答已采纳
1
回答
在提交函数中使用useAsync钩子的思路
、
、
import DatePicker from 'react-datepicker'import { useAsync } from '
react-async
'PUT' : 'POST', const { data, error, isPending} = useAsync({
promiseFn
浏览 3
提问于2021-10-27
得票数 0
回答已采纳
3
回答
如何在服务器上呈现异步初始化的组件
、
我对ReactJS相对比较陌生,并且已经被实现服务器端渲染以减少“第一条推文的时间”的简单性所吸引。我正在运行一个Node-Express-React堆栈,它使用React的renderComponentToString在服务器上预先呈现标记。以React网站上的例子为例: $.get(this.props.source, function(result) {
浏览 1
提问于2013-12-28
得票数 19
2
回答
.map异步回调和事件循环
此代码片段摘自:const jsonPromises = urls.map(async url => { return response.json();我知道,最终,jsonPromises将是一系列的承诺。然而,我不完全确定这是如何发生的。 根据我的理解,当执行到这一行const response = await fetch(url);时,它会将它从调用堆栈移动到Web,对return response.json();做同样的操作
浏览 4
提问于2019-12-06
得票数 0
回答已采纳
2
回答
JSDoc标记支持自定义(高阶组件)
、
使用记录的正确方法是什么?当然,没有任何内置的React-specific tags --那么正确的方法是什么呢?
浏览 3
提问于2017-05-06
得票数 20
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
实时音视频
对象存储
云直播
活动推荐
运营活动
广告
关闭
领券