Back to Blog

state 跟 props 的差別

#state

state 是管理元件的狀態,state 的值可以改變。

#props

props 則是被傳遞進元件,用於父元件與子元件的溝通,值不可以改變。