mirror of
https://github.com/expo/react-conf-experience.git
synced 2026-11-15 17:38:46 -10:00
42 lines
721 B
JavaScript
42 lines
721 B
JavaScript
/**
|
|
* @providesModule ExText
|
|
*/
|
|
'use strict';
|
|
|
|
import React, {
|
|
Platform,
|
|
StyleSheet,
|
|
Text,
|
|
} from 'react-native';
|
|
|
|
export default class ExText extends React.Component {
|
|
render() {
|
|
return (
|
|
<Text
|
|
ref={this._setTextRef.bind(this)}
|
|
{...this.props}
|
|
style={[styles.base, this.props.style]}>
|
|
{this.props.children}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
setNativeProps(nativeProps) {
|
|
this._textRef.setNativeProps(nativeProps);
|
|
}
|
|
|
|
_setTextRef(component) {
|
|
this._textRef = component;
|
|
|
|
if (typeof this.props.textRef === 'function') {
|
|
this.props.textRef(component);
|
|
}
|
|
}
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
base: {
|
|
fontFamily: 'FreightSansLFPro',
|
|
},
|
|
});
|