<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>reactjs - 標籤 - weichen's note</title><link>https://droyuki.github.io/tags/reactjs/</link><description>reactjs - 標籤 - weichen's note</description><generator>Hugo -- gohugo.io</generator><language>zh-TW</language><managingEditor>droyuki@gmail.com (weichen)</managingEditor><webMaster>droyuki@gmail.com (weichen)</webMaster><lastBuildDate>Wed, 06 May 2020 14:36:54 +0800</lastBuildDate><atom:link href="https://droyuki.github.io/tags/reactjs/" rel="self" type="application/rss+xml"/><item><title>React 單元測試 - Test Was Not Wrap in Act ?</title><link>https://droyuki.github.io/2020/05/react-test-was-not-wrap-in-act/</link><pubDate>Wed, 06 May 2020 14:36:54 +0800</pubDate><author>weichen</author><guid>https://droyuki.github.io/2020/05/react-test-was-not-wrap-in-act/</guid><description>Warning: An update to Demo inside a test was not wrapped in act(&amp;hellip;). 最近在寫單元測試，遇到這個神奇的 warning，記錄一下。 情境: 假設有一個元件，點了會更新 state 並呼叫 props.onChange class 版: 1 2 3 4</description></item><item><title>透過 redux-thunk 處理非同步 action</title><link>https://droyuki.github.io/2020/01/redux-thunk-async-action/</link><pubDate>Fri, 17 Jan 2020 16:06:01 +0800</pubDate><author>weichen</author><guid>https://droyuki.github.io/2020/01/redux-thunk-async-action/</guid><description>首先必須知道幾個重點 Redux 不會管你是否同步，想要更新 store ，就必須呼叫 dispatch() Redux 原始碼中，dispatch function 的實作是此 function 會回傳其第一個參數 1 2 // 也就是若執</description></item><item><title>React + Redux 常見問題</title><link>https://droyuki.github.io/2020/01/react-redux-faq/</link><pubDate>Fri, 17 Jan 2020 14:51:25 +0800</pubDate><author>weichen</author><guid>https://droyuki.github.io/2020/01/react-redux-faq/</guid><description>React + Redux 常見問題 Q1: Flux Pattern 是什麼? Flux Pattern 是一個單向資料流設計模式，React 中所有元件都建議採用，以單向資料流的概念避免產生 side effect 由 React 渲染出view，</description></item><item><title>React.js 到底要在哪 bind this ?</title><link>https://droyuki.github.io/2019/05/react-bind-this/</link><pubDate>Fri, 24 May 2019 13:05:27 +0800</pubDate><author>weichen</author><guid>https://droyuki.github.io/2019/05/react-bind-this/</guid><description>TL;DR class property + arrow function 才是王道 情境: 假設你有一個&amp;lt;Button /&amp;gt;元件，其 onClick 中會需要時使用 this.props 或 this.state 這時就會需要將 onClick function 綁定元件的 this。 而綁</description></item></channel></rss>