मैं प्रतिक्रिया जेएस में नया हूं।getDefaultProps के बीच क्या अंतर है और getInitialState प्रतिक्रिया js
getInitialState() {
return {
backgroundColor: 'gray',
height: 200,
width: 200
}
},
क्या दोनों के बीच में तार्किक अंतर है:
getDefaultProps() {
return {
backgroundColor: 'gray',
height: 200,
width: 200
}
},
मैं getDefaultProps
के लिए और getInitialState
के लिए एक ही मान है। जो ओवरराइड करना चाहिए या कौन सा पहला निष्पादित करेगा।
धन्यवाद।
https://www.google.com/search?btnG=1&pws=0&q=difference+between+state+and+props – StackOverMySoul