Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.5k views
in Technique[技术] by (71.8m points)

React 子组件怎么获取异步props?

举个例子:
父组件 componentWillMount 时:
ajax请求回来的数据menu,丢给子组件

<Filter {...menu} />

子组件的props,有时接接不到,打印不出来
有时候有,有时候没有,

是不是异步请求导致的? 怎么破?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

你隔哪打印的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...