What are Props and how is it used in React Native?
Props are means to the parameters that are used for customizing the component when the component is being created or re-rendered. They are more like the argument which is passed to the React component.
BY Best Interview Question ON 03 Mar 2023
Example
import React, {Component} from 'react';
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;