Skip to content

關於placeholder in react #14

Description

@AngeloETH

Huli大您好,我之前有上過您的前端新手加強班並動手實作作業1作業9,目前自行將作業10的內容branch成用react改寫整個作業1作業9 XD,這邊想請教一個placeholder的問題: 在react中,可否直接將placeholder的資料包成物件在constructor時放在state的一個array中({frame: Array(limit).fill(placeholder)},然後placeholder是個物件放那些暫位圖及文字這樣),然後在componentDidMount()時發送request拿twitch api,當拿到api後直接setState將state的frame改成api的資料,如此也能達到placeholder的效果,不知道在實務上這樣操作跟您該課程第五周教的placeholder方法會使用哪種呢? 優劣又是為何?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions