( widget: RNText, newProps: TextProps, oldProps: TextProps )
| 15 | * @ignore |
| 16 | */ |
| 17 | export const setTextProps = ( |
| 18 | widget: RNText, |
| 19 | newProps: TextProps, |
| 20 | oldProps: TextProps |
| 21 | ) => { |
| 22 | const setter: TextProps = { |
| 23 | set children(text: string | number | Array<string | number>) { |
| 24 | text = Array.isArray(text) ? text.join('') : text; |
| 25 | |
| 26 | widget.setText(text); |
| 27 | }, |
| 28 | set wordWrap(shouldWrap: boolean) { |
| 29 | widget.setWordWrap(shouldWrap); |
| 30 | }, |
| 31 | set scaledContents(scaled: boolean) { |
| 32 | widget.setProperty('scaledContents', scaled); |
| 33 | }, |
| 34 | set openExternalLinks(shouldOpenExternalLinks: boolean) { |
| 35 | widget.setProperty('openExternalLinks', shouldOpenExternalLinks); |
| 36 | }, |
| 37 | set textInteractionFlags(interactionFlag: TextInteractionFlag){ |
| 38 | widget.setProperty('textInteractionFlags', interactionFlag); |
| 39 | } |
| 40 | }; |
| 41 | Object.assign(setter, newProps); |
| 42 | setViewProps(widget, newProps, oldProps); |
| 43 | }; |
| 44 | |
| 45 | /** |
| 46 | * @ignore |
no test coverage detected