AndyWang′s Blog
About
Archive
Category
Tags
Home
About
Archive
Category
Tags
Archive
Categories
React
React
5 posts in this category
Common Mistakes with useEffect Dependencies
2024年11月22日
React
Notes
/
React
Notes
/
React
useEffect 作為 cleanup function,是個強大的副作用處理函式,但如果加了錯誤的依賴,可能導致效能變差,或發生無法預期的行為。此外也談談一些對 useEffect 的誤解。
8 mins read
|
1925 words
Using SWR for Better Data Fetching
2024年10月16日
React
Notes
/
React
+1
Notes
/
React
/
SWR
傳統 API Data Fetching 經常需要依賴 state、redux 管理狀態,同時也要為效能優化去實作,如:Cache、Revalidate、Asynchronous、Dependent Fetching 等機制,但這些都可以透過 SWR 來簡化。
6 mins read
|
1286 words
Handling Errors Gracefully in React
2024年10月14日
React
Notes
/
React
+1
Notes
/
React
/
ErrorBoundary
錯誤處理對開發者一直都是門課題,不論系統穩定性或使用者體驗都十分重要。而在 React 16 中引入了 Error Boundaries 能夠用來捕捉渲染錯誤進而導致頁面崩潰的問題。
4 mins read
|
1000 words
Redux Toolkit (RTK) 簡化狀態管理
2024年9月5日
React
Notes
/
React
+1
Notes
/
React
/
Redux
在 Redux Toolkit 出現前,使用 Redux 頻繁操作 state 是一件相對麻煩的事情,而 Redux Toolkit 的出現簡化了重複性流程,也提供了一些 API 減少重複性質的程式碼。
6 mins read
|
1301 words
React 開發上的小技巧
2024年8月12日
React
Notes
/
React
Notes
/
React
平時在撰寫 React 最常做的動作不外乎就是建立元件、匯入 Hook 或其他 lib,本篇分享幾個快捷鍵加快開發的小技巧,另外也會提到幾個快捷鍵重寫變數、快速調整程式碼排版等等。
4 mins read
|
761 words