剛剛開始與react-router。這個React組件中的{... props}是什麼意思?
我在使用[email protected](版本4)時遇到了github(位於底部)的這段代碼。我有弱的React + ES6-fu因此需要你的幫助。
- {...道具}這裏指的是發送道具的組件?
- {... props}如何影響custom =「prop」?
Ž
<Match pattern="/foo"
render={(props) => (
<YourRouteComponent {...props} custom="prop"/>
)}
/>
在您的最後一個示例中,propC =「someOtherValue」被propC上的{... props}覆蓋了嗎? – Snail
是的,這是正確的。 –