Skip to content

Commit 89d04cf

Browse files
authored
Change from codegenNativeComponent to requireNativeComponent in order to fix error after transpilation (#3768)
* Change from codegenNativeComponent to requireNativeComponent * Update snapshot
1 parent 3a892d3 commit 89d04cf

File tree

4 files changed

+41
-34
lines changed

4 files changed

+41
-34
lines changed

lib/components/HighlighterOverlayView/HighlighterViewNativeComponent.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import type {ViewProps} from 'react-native';
1+
// import type {ViewProps} from 'react-native';
2+
import {requireNativeComponent, type ViewProps} from 'react-native';
23
import type {
34
Float,
45
Int32,
56
WithDefault
67
} from 'react-native/Libraries/Types/CodegenTypes';
7-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
8+
// import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
89

910
export interface HighlightFrame {
1011
x: Float;
@@ -32,46 +33,50 @@ export interface NativeProps extends ViewProps {
3233
* The frame to highlight with x, y, width, height coordinates
3334
*/
3435
highlightFrame?: HighlightFrame;
35-
36+
3637
/**
3738
* The overlay color (processed color int for Android)
3839
*/
3940
overlayColor?: WithDefault<Int32, 0>;
40-
41+
4142
/**
4243
* The border radius for the highlighted area
4344
*/
4445
borderRadius?: WithDefault<Float, 0>;
45-
46+
4647
/**
4748
* The stroke color (processed color int for Android)
4849
*/
4950
strokeColor?: WithDefault<Int32, 0>;
50-
51+
5152
/**
5253
* The stroke width
5354
*/
5455
strokeWidth?: WithDefault<Float, 0>;
55-
56+
5657
/**
5758
* The React tag of the view to highlight
5859
*/
5960
highlightViewTag?: Int32;
60-
61+
6162
/**
6263
* Parameters for view-based highlighting including padding and offset
6364
*/
6465
highlightViewTagParams?: HighlightViewTagParams;
65-
66+
6667
/**
6768
* Minimum rectangle size for the highlight area
6869
*/
6970
minimumRectSize?: MinimumRectSize;
70-
71+
7172
/**
7273
* Inner padding for the highlight area
7374
*/
7475
innerPadding?: WithDefault<Float, 0>;
7576
}
7677

77-
export default codegenNativeComponent<NativeProps>('HighlighterView');
78+
// export default codegenNativeComponent<NativeProps>('HighlighterView');
79+
80+
const HighlighterViewNativeComponent = requireNativeComponent<NativeProps>('HighlighterView');
81+
82+
export default HighlighterViewNativeComponent;
Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,74 @@
1-
import type {ViewProps} from 'react-native';
2-
import type {
3-
Int32,
4-
WithDefault
5-
} from 'react-native/Libraries/Types/CodegenTypes';
6-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
1+
// import type {ViewProps} from 'react-native';
2+
import {requireNativeComponent, type ViewProps} from 'react-native';
3+
import type {Int32, WithDefault} from 'react-native/Libraries/Types/CodegenTypes';
4+
// import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
75

86
export interface NativeProps extends ViewProps {
97
/**
108
* Enables tracking of the keyboard when it's dismissed interactively (false by default).
119
*/
1210
trackInteractive?: WithDefault<boolean, false>;
13-
11+
1412
/**
1513
* iOS only.
1614
* Show the keyboard on a negative scroll
1715
*/
1816
revealKeyboardInteractive?: WithDefault<boolean, false>;
19-
17+
2018
/**
2119
* iOS only.
2220
* Set to false to turn off inset management and manage it yourself
2321
*/
2422
manageScrollView?: WithDefault<boolean, true>;
25-
23+
2624
/**
2725
* iOS only.
2826
* Set to true manageScrollView is set to true and still does not work
2927
*/
3028
requiresSameParentToManageScrollView?: WithDefault<boolean, false>;
31-
29+
3230
/**
3331
* iOS only.
3432
* Allow hitting sub-views that are placed beyond the view bounds
3533
*/
3634
allowHitsOutsideBounds?: WithDefault<boolean, false>;
37-
35+
3836
/**
3937
* Should the scrollView scroll to the focused input
4038
*/
4139
scrollToFocusedInput?: WithDefault<boolean, false>;
42-
40+
4341
/**
4442
* iOS only.
4543
* The scrolling behavior (NONE | SCROLL_TO_BOTTOM_INVERTED_ONLY | FIXED_OFFSET)
4644
*/
4745
scrollBehavior?: WithDefault<Int32, 0>;
48-
46+
4947
/**
5048
* iOS only.
5149
* Add a SafeArea view beneath the KeyboardAccessoryView
5250
*/
5351
addBottomView?: WithDefault<boolean, false>;
54-
52+
5553
/**
5654
* iOS only.
5755
* The bottom view's color
5856
*/
5957
bottomViewColor?: string;
60-
58+
6159
/**
6260
* Allow control safe area
6361
*/
6462
useSafeArea?: WithDefault<boolean, false>;
65-
63+
6664
/**
6765
* Whether or not to include bottom tab bar inset
6866
*/
6967
usesBottomTabs?: WithDefault<boolean, false>;
7068
}
7169

72-
export default codegenNativeComponent<NativeProps>('KeyboardTrackingViewTemp');
70+
// export default codegenNativeComponent<NativeProps>('KeyboardTrackingViewTemp');
71+
72+
const KeyboardTrackingViewNativeComponent = requireNativeComponent<NativeProps>('KeyboardTrackingViewTemp');
73+
74+
export default KeyboardTrackingViewNativeComponent;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"react-native-redash": "^12.0.3",
5757
"semver": "^5.5.0",
5858
"tinycolor2": "^1.4.2",
59-
"uilib-native": "5.0.0-snapshot.7204",
59+
"uilib-native": "5.0.0-snapshot.7207",
6060
"url-parse": "^1.2.0",
6161
"wix-react-native-text-size": "1.0.9"
6262
},

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10928,7 +10928,7 @@ __metadata:
1092810928
shell-utils: ^1.0.10
1092910929
tinycolor2: ^1.4.2
1093010930
typescript: 5.0.4
10931-
uilib-native: 5.0.0-snapshot.7204
10931+
uilib-native: 5.0.0-snapshot.7207
1093210932
url-parse: ^1.2.0
1093310933
wix-react-native-text-size: 1.0.9
1093410934
peerDependencies:
@@ -12560,16 +12560,16 @@ __metadata:
1256012560
languageName: node
1256112561
linkType: hard
1256212562

12563-
"uilib-native@npm:5.0.0-snapshot.7204":
12564-
version: 5.0.0-snapshot.7204
12565-
resolution: "uilib-native@npm:5.0.0-snapshot.7204"
12563+
"uilib-native@npm:5.0.0-snapshot.7207":
12564+
version: 5.0.0-snapshot.7207
12565+
resolution: "uilib-native@npm:5.0.0-snapshot.7207"
1256612566
dependencies:
1256712567
lodash: ^4.17.21
1256812568
prop-types: ^15.5.10
1256912569
peerDependencies:
1257012570
react: ">=17.0.1"
1257112571
react-native: ">=0.64.1"
12572-
checksum: 9f922ec1e91d2f1609930e932b182ea48b03b07c2c79ef61569a1277be4120d6434782e91874a058998b5703dff53a94c2a504142066812489c915a2a8c24820
12572+
checksum: 3246a839f411acc4b05507eb3f1c1eea350b38268c8167e68fe6ca123985a53b848578df33bf738aee230cd2ef535bc41bd975d1e1f848e7263ff59ee7ae04e9
1257312573
languageName: node
1257412574
linkType: hard
1257512575

0 commit comments

Comments
 (0)