第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

React Component 上的 Typescript 錯誤:

React Component 上的 Typescript 錯誤:

臨摹微笑 2022-12-22 14:38:58
我不確定為什么它在這里抱怨TBH,這個錯誤讓我感到困惑。createLinkSetsForCountryfunction createLinkSetsForCountry(country: Country, companies: Array<Company>) {    let companyLinks: Array<LinkItem> = [];    const companyLinkSets = [];    for (const company of companies) {        companyLinks.push(<LinkItem company={company} key={company.id} />);        companyLinkSets.push(            <LinkSet                className="ft-link-set"                country={country}                key={company.id}                links={companyLinks} />        );        companyLinks = [];    }    return (        <div>            <ListHeader country={country} />            <div>{companyLinkSets}</div>        </div>    );}鏈接項(xiàng)export class LinkItem extends Component<{ company: Company, key: number }> {    render() {        const { company } = this.props,            hasApp = (company.interview                && company.interview.app                && company.interview.app.hasAppp),            uri = company.notInterviewed ? `companies/${company.id}/details` : `/interviews/companies/${company.id}`,            className = `margin-top-10 margin-bottom-10 ${                company.notInterviewed ? 'ft-company-not-interviewed' : ''            }`;        const link = (            <Link className={className} id={company.id.toString()} to={uri}>                <span id="company-name">{company.name}</span>            </Link>        );  
查看完整描述

1 回答

?
慕村9548890

TA貢獻(xiàn)1884條經(jīng)驗(yàn) 獲得超4個贊

基本上,您companyLinks的列表是 React 元素而不是LinkItem,因此只需按以下方式進(jìn)行更改即可:

let companyLinks: Array<React.ReactElement> = [];


查看完整回答
反對 回復(fù) 2022-12-22
  • 1 回答
  • 0 關(guān)注
  • 65 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號