小编lut*_*kyn的帖子

收到解析为:未定义的承诺。Promise 元素必须解析为类或函数

我正在尝试在反应中使用延迟加载。我从 react 中导入了 lazy 和 Suspense 组件。该页面不再显示任何内容。但我得到的错误是:

预期动态 import() 调用的结果。而是收到:[object Object]。元素类型无效。收到解析为:未定义的承诺。Promise 元素必须解析为类或函数。

这是 SibaCard 组件

export  class SibaCard extends React.Component<ICardProps, ICardState> {
constructor(props: ICardProps) {
    super(props);
    this.state = {expanded: true};
}

expandChange = () => {
    this.setState((prevState: any) => ({ expanded: !prevState.expanded }));
}

style = {
    headerStyle: {
        borderBottom: "2px solid #258ECB",
        marginBottom: "1em",
        background: "linear-gradient(rgba(0,0,0,0.0),rgba(0,0,0,0.02))"
    },
    containerStyle: {

    }
}
render() {
    return (
        <Card
            style={{ border: "1px solid rgba(0,0,0,0.1)",marginTop: "4.5em", boxShadow:"none" }}
            expanded={this.state.expanded}
            expandable={false}
            containerStyle={this.style.containerStyle}
            onExpandChange={this.expandChange.bind(this)}
        > …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs

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

零除外可归零

我正在为员工的贷款计划付款做一些计算,我一直在努力

ClassName:"System.DivideByZeroException",消息:"试图除以零."

我不知道我做错了什么,也许我没有把小数点好.

private static decimal ReturnPayments(decimal loanAmount, int durationMonths, decimal interestMonthly)
{
   return (loanAmount * interestMonthly)/ (decimal) (1-Math.Pow((int)(1 
                                                                      + interestMonthly), -durationMonths));
}
public IEnumerable<LoanRepaymentSchedule> GetRepayment(string employeeId, decimal principalAmt, decimal rate, int terms)
{
   var employee = _employeeService.FindByAsync(e => e.Id == employeeId 
                                                    && e.Status == EntityStatus.Active).Result;
   var results = employee.FirstOrDefault();
   var currentBalance = principalAmt - 0;
   decimal monthlyRate = rate / 1200;
   var monthlyPaymentAmt = ReturnPayments(currentBalance, terms, monthlyRate);
   var result = new List<LoanRepaymentSchedule>();
   for (var currentPayment =1; currentPayment<= terms; currentPayment++) …
Run Code Online (Sandbox Code Playgroud)

c#

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

标签 统计

c# ×1

javascript ×1

reactjs ×1