/
githubmirror
/
styled-components
Обзор
Документация
Войти
/
githubmirror
/
styled-components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/benchmarks/src/app/Text.js
29 строк
655 B
Evan Jacobs
chore(bench): modernize benchmark UI, upgrade libraries, fix implementations
28 мар 2026, 01:06
28 мар 2026, 01:06
9b559a8
Код
Авторство
О чём код?
import { bool } from 'prop-types'; import React from 'react'; import { StyleSheet, Text } from 'react-native'; import { font } from './constants'; class AppText extends React.Component { static displayName = '@app/Text'; static contextTypes = { isInAParentText: bool, }; render() { const { style, ...rest } = this.props; const { isInAParentText } = this.context; return <Text {...rest} style={[!isInAParentText && styles.baseText, style]} />; } } const styles = StyleSheet.create({ baseText: { color: 'var(--bench-text)', fontFamily: font, fontSize: 13, lineHeight: '1.4', }, }); export default AppText;