MCPcopy Index your code
hub / github.com/nodegui/react-nodegui / setTextProps

Function setTextProps

src/components/Text/RNText.ts:17–43  ·  view source on GitHub ↗
(
  widget: RNText,
  newProps: TextProps,
  oldProps: TextProps
)

Source from the content-addressed store, hash-verified

15 * @ignore
16 */
17export 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

Callers 3

setImagePropsFunction · 0.90
setAnimatedImagePropsFunction · 0.90
setPropsMethod · 0.85

Calls 1

setViewPropsFunction · 0.90

Tested by

no test coverage detected