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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

是否可以使用 HOC 將字符串?dāng)?shù)組作為參數(shù)傳遞?

是否可以使用 HOC 將字符串?dāng)?shù)組作為參數(shù)傳遞?

森林海 2021-06-15 17:08:14
我在我的 nextJS 應(yīng)用程序中使用了一些 HOC 組件來通過getInitialProps. 但是我需要為這些道具使用動(dòng)態(tài)值。在我的索引組件中,我正在調(diào)用withServerProps. 是否可以將一些字符串?dāng)?shù)組傳遞給它?索引.jsimport React, { Component } from 'react'import { withTranslation } from 'i18n'import withServerProps from 'with-server-props'class Index extends Component {  render () {    return (<div>Some content</div>)  }}export default withServerProps( // <-- How to pass an array with strings?  withTranslation()(Index) )我需要在這個(gè)函數(shù)中獲取字符串?dāng)?shù)組:with-server-props.jsimport React, { Component } from 'react'export default WrappedComponent =>  class extends Component {    static async getInitialProps (context) {      const { query } = context      return {        id: query && query.id        target: PASSED_ARRAY // <-- Need to recieve the array here      }    }    render () {      return <WrappedComponent {...this.props} />    }  }
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 141 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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