( widget: RNLineEdit, newProps: LineEditProps, oldProps: LineEditProps )
| 37 | } |
| 38 | |
| 39 | const setLineEditProps = ( |
| 40 | widget: RNLineEdit, |
| 41 | newProps: LineEditProps, |
| 42 | oldProps: LineEditProps |
| 43 | ) => { |
| 44 | const setter: LineEditProps = { |
| 45 | set text(text: string) { |
| 46 | text ? widget.setText(text) : widget.clear(); |
| 47 | }, |
| 48 | set placeholderText(text: string) { |
| 49 | widget.setPlaceholderText(text); |
| 50 | }, |
| 51 | set readOnly(isReadOnly: boolean) { |
| 52 | widget.setReadOnly(isReadOnly); |
| 53 | }, |
| 54 | set echoMode(mode: EchoMode) { |
| 55 | widget.setEchoMode(mode); |
| 56 | } |
| 57 | }; |
| 58 | Object.assign(setter, newProps); |
| 59 | setViewProps(widget, newProps, oldProps); |
| 60 | }; |
| 61 | |
| 62 | /** |
| 63 | * @ignore |
no test coverage detected