Skip to content

Commit

Permalink
Merge pull request #612 from dlahish/patch-1
Browse files Browse the repository at this point in the history
Add childrenProps to ParsedText
  • Loading branch information
brunocascio committed Oct 28, 2017
2 parents b2be2b5 + ed7805a commit fae9fcf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/MessageText.js
Expand Up @@ -69,13 +69,14 @@ export default class MessageText extends React.Component {
return (
<View style={[styles[this.props.position].container, this.props.containerStyle[this.props.position]]}>
<ParsedText
style={[styles[this.props.position].text, this.props.textStyle[this.props.position]]}
style={[styles[this.props.position].text, this.props.textStyle[this.props.position], this.props.customTextStyle]}
parse={[
...this.props.parsePatterns(linkStyle),
{type: 'url', style: linkStyle, onPress: this.onUrlPress},
{type: 'phone', style: linkStyle, onPress: this.onPhonePress},
{type: 'email', style: linkStyle, onPress: this.onEmailPress},
]}
childrenProps={{...this.props.textProps}}
>
{this.props.currentMessage.text}
</ParsedText>
Expand Down Expand Up @@ -151,4 +152,6 @@ MessageText.propTypes = {
right: Text.propTypes.style,
}),
parsePatterns: PropTypes.func,
textProps: PropTypes.object,
customTextStyle: Text.propTypes.style,
};

0 comments on commit fae9fcf

Please sign in to comment.