In React Native, standard list components are not available by default. This code snippet showcases a custom bullet list component designed to fill this gap. With custom styles and a simple yet effective structure, the component renders a list of items with bullet points. Each item is composed of a bold bullet and corresponding text.
Source code viewer
import React from 'react'; import { View, Text, StyleSheet } from 'react-native'; const BulletList = () => { const bulletList = [ "List item 1.", "List item 2." ]; return ( <View style={styles.ul}> {bulletList.map((item, index) => ( <View style={styles.li} key={index}> <Text style={styles.liBullet}>• </Text> <Text style={styles.liText}>{item}</Text> </View> ))} </View> ); }; const styles = StyleSheet.create({ ul: { flexDirection: 'column', alignItems: 'flex-start', }, li: { flexDirection: 'row', alignItems: 'flex-start', }, liBullet: { fontWeight: 'bold', fontSize: 24, }, liText: { fontSize: 18, }, }); export default BulletList;Programming Language: ECMAScript