@@ -22,6 +22,7 @@ @implementation MarkdownTextInputDecoratorView {
22
22
#else
23
23
__weak RCTBaseTextInputView *_textInput;
24
24
#endif /* RCT_NEW_ARCH_ENABLED */
25
+ __weak UIView<RCTBackedTextInputViewProtocol> *_backedTextInputView;
25
26
__weak RCTBackedTextFieldDelegateAdapter *_adapter;
26
27
__weak RCTUITextView *_textView;
27
28
}
@@ -51,24 +52,24 @@ - (void)didMoveToWindow {
51
52
#ifdef RCT_NEW_ARCH_ENABLED
52
53
react_native_assert ([view isKindOfClass: [RCTTextInputComponentView class ]] && " Previous sibling component is not an instance of RCTTextInputComponentView." );
53
54
_textInput = (RCTTextInputComponentView *)view;
54
- UIView<RCTBackedTextInputViewProtocol> *backedTextInputView = [_textInput valueForKey: @" _backedTextInputView" ];
55
+ _backedTextInputView = [_textInput valueForKey: @" _backedTextInputView" ];
55
56
#else
56
57
react_native_assert ([view isKindOfClass: [RCTBaseTextInputView class ]] && " Previous sibling component is not an instance of RCTBaseTextInputView." );
57
58
_textInput = (RCTBaseTextInputView *)view;
58
- UIView<RCTBackedTextInputViewProtocol> *backedTextInputView = _textInput.backedTextInputView ;
59
+ _backedTextInputView = _textInput.backedTextInputView ;
59
60
#endif /* RCT_NEW_ARCH_ENABLED */
60
61
61
62
_markdownUtils = [[RCTMarkdownUtils alloc ] init ];
62
63
react_native_assert (_markdownStyle != nil );
63
64
[_markdownUtils setMarkdownStyle: _markdownStyle];
64
65
65
66
[_textInput setMarkdownUtils: _markdownUtils];
66
- if ([backedTextInputView isKindOfClass: [RCTUITextField class ]]) {
67
- RCTUITextField *textField = (RCTUITextField *)backedTextInputView ;
67
+ if ([_backedTextInputView isKindOfClass: [RCTUITextField class ]]) {
68
+ RCTUITextField *textField = (RCTUITextField *)_backedTextInputView ;
68
69
_adapter = [textField valueForKey: @" textInputDelegateAdapter" ];
69
70
[_adapter setMarkdownUtils: _markdownUtils];
70
- } else if ([backedTextInputView isKindOfClass: [RCTUITextView class ]]) {
71
- _textView = (RCTUITextView *)backedTextInputView ;
71
+ } else if ([_backedTextInputView isKindOfClass: [RCTUITextView class ]]) {
72
+ _textView = (RCTUITextView *)_backedTextInputView ;
72
73
[_textView setMarkdownUtils: _markdownUtils];
73
74
NSLayoutManager *layoutManager = _textView.layoutManager ; // switching to TextKit 1 compatibility mode
74
75
layoutManager.allowsNonContiguousLayout = NO ; // workaround for onScroll issue
@@ -103,7 +104,7 @@ - (void)setMarkdownStyle:(RCTMarkdownStyle *)markdownStyle
103
104
104
105
// apply new styles
105
106
#ifdef RCT_NEW_ARCH_ENABLED
106
- [_textInput _setAttributedString: _textInput .attributedText];
107
+ [_textInput _setAttributedString: _backedTextInputView .attributedText];
107
108
#else
108
109
[_textInput setAttributedText: _textInput.attributedText];
109
110
#endif /* RCT_NEW_ARCH_ENABLED */
0 commit comments