從Babel AST 角度分析來看,相比Vue轉React,React轉Vue是相對於比較簡單的,比如關鍵字 setState 關鍵字。因爲Vue 用 this.xxx 來做賦值操作,而react 用 setState,React轉Vue只需要搜索setState 關鍵字,而Vue轉React則需要搜索this 賦值關鍵字,操作比較煩瑣。
生命週期對比:
props對比:
更多查看工具:
從Babel AST 角度分析來看,相比Vue轉React,React轉Vue是相對於比較簡單的,比如關鍵字 setState 關鍵字。因爲Vue 用 this.xxx 來做賦值操作,而react 用 setState,React轉Vue只需要搜索setState 關鍵字,而Vue轉React則需要搜索this 賦值關鍵字,操作比較煩瑣。
生命週期對比:
props對比:
更多查看工具: