Is it possible to use defaultProps in React Native? I’ve tried the following 2 ways of defining defaultProps and I get null when trying to access the defaultProp
<
I always do it like this and it works just fine:
class Foo extends React.Component {}; Foo.propTypes = { animateBackground: PropTypes.bool }; Foo.defaultProps = { animateBackground: false }; export default Foo;