We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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方法會使用哪種呢? 優劣又是為何?
{frame: Array(limit).fill(placeholder)}
The text was updated successfully, but these errors were encountered:
你這樣做法還是有差喔 差別在於你 setState 之後,新的那些圖片依然還是需要時間載入,所以你還是會看到有一瞬間畫面是沒有任何圖片的,連佔位圖也沒有,因為你已經是新的 state 了
Sorry, something went wrong.
No branches or pull requests
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方法會使用哪種呢? 優劣又是為何?The text was updated successfully, but these errors were encountered: