Open idev0085 opened 2 years ago
Yes, default props available in React Native as they are for React, If for an instance we do not pass props value, the component will use the default props value.
import {View, Text} from 'react-native'; class DefaultPropComponent extends Component { render() { return ( <View> <Text> {this.props.name} </Text> </View> ) } } Demo.defaultProps = { name: 'BOB' } export default DefaultPropComponent;
Yes, default props available in React Native as they are for React, If for an instance we do not pass props value, the component will use the default props value.