Answer the question
In order to leave comments, you need to log in
How and where in ES6 will it be correct to put propTypes?
propTypes: {
data: React.PropTypes.object.isRequired
},
Answer the question
In order to leave comments, you need to log in
class SomeComponent extends React.Component {
...
}
SomeComponent.propTypes = {
data: React.PropTypes.object.isRequired
}
class SomeComponent extends React.Component {
get propTypes() {
return {
data: React.PropTypes.object.isRequired
};
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question