- Components whose only job is to render a view according to the styling and data passed to them.
- They do not contain any business logic
- They don’t have direct access to data stores. Data is passed to them via
props
.
Example of a dumb component.
import React, {Component} from 'react';
import {View} from 'react-native';
import styles from './Header.component.style';
class Header extends Component {
render () {
const {title, subtitle} = this.props;
return (
<View style={styles.container}>
<View style={styles.titleHeading}>{title}</View>
<View style={styles.subtitle}>{subtitle}</View>
</View>
);
}
}
export default Header;