reactjs – React Starter Kit错误 – 找不到页面

前端之家收集整理的这篇文章主要介绍了reactjs – React Starter Kit错误 – 找不到页面前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我从react-starter-kit项目中创建了一个新路由,它对一些数据进行异步提取,然后呈现它,但是一秒钟之后页面重新加载,并显示“找不到页面 – 抱歉,但页面是你的”试图查看不存在“.

在控制台中,我看到 – “警告:文本内容不匹配.服务器:”余额“客户端:”找不到页面

async function action() {

let bittrex = new ccxt.bittrex ({
    'apiKey': '','secret': ''
})

try {

    // fetch account balance from the exchange
    let bittrexBalance = await bittrex.fetchBalance ()
    /**** commenting above and uncommenting this block stops it from happening.... 
    let bittrexBalance = {};
    bittrexBalance.info= [];
    let currency = {};
    currency.Currency = "BTC";
    currency.Value=999;
    // output the result
    bittrexBalance.info.push(currency);*/
    console.log ('balance',bittrexBalance)

    let balances = [];
    balances.push(bittrexBalance)
    return {
        title: "Balances",component: (
            <Layout>
                <Balances balances={balances} />
            </Layout>
        ),};


} catch (e) {
    console.log('SOME sort of error',e);
}

有谁知道这可能是什么?

编辑添加,我现在意识到,如果我禁用Javascript一切正常…

它似乎在两次通过通用路由器.第一次

The second time it runs through the router it seems to have a params appears to have an object of {0: "/balances"}

这是我到目前为止找到的唯一线索……我不明白为什么它已经加载后重新加载页面

页面未找到错误来自它:

第二次捕获(e)…我怀疑ccxt库中发生了一些事情,但问题实际上是第二次调用它,因为页面以某种方式重新加载……

看来你必须在获取Balance之前调用await bittrex.loadProducts().

编辑:似乎bittrex.loadMarkets()已重命名bittrex.loadProducts()
更多信息在this issue on github

原文链接:https://www.f2er.com/react/300706.html

猜你在找的React相关文章