@uiw/react-native
Version:
UIW for React Native
24 lines (23 loc) • 727 B
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, Text } from 'react-native';
import { useTheme } from '@shopify/restyle';
const styles = StyleSheet.create({
default: {
flexWrap: 'wrap',
flexDirection: 'row',
marginVertical: 10,
},
});
export default function P(props) {
const theme = useTheme();
const textColor = theme.colors.primary_text || '#ccc';
return (<Text {...props} style={[styles.default, props.style, { color: textColor }]}>
{props.children}
</Text>);
}
P.propTypes = {
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node, PropTypes.string]),
style: PropTypes.any,
};
P.defaultProps = {};