基礎知識點
1、react中的狀態(tài)管理。
????????和vue中的狀態(tài)管理有些相似,只不過react中是依托于mobx的。
????????舉例寫法:
創(chuàng)建store.ts
import { observable, action } from 'mobx'
export class Store {
@observable status= 0
@action getStatus = async () => {}
}
export default new Store()
頁面中使用store
import Store from './store'
const { getStatus } = Store
2、react中的變量聲明方式。
? ? ? ? 在react中使用變量有兩種方式,一種是利用store中的變量,動態(tài)改變數(shù)據(jù),一種是利用useState。文章來源:http://www.zghlxwxcb.cn/news/detail-515493.html
? ? ? ? 舉例寫法:文章來源地址http://www.zghlxwxcb.cn/news/detail-515493.html
const [decreaseDis, setDecreaseDis] = useState(false)
useEffect(() => {
setDecreaseDis(false)
}, [])
到了這里,關于react + antDesign新手進階學習指南的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!