Skip to content

Change from codegenNativeComponent to requireNativeComponent in order to fix error after transpilation #3768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type {ViewProps} from 'react-native';
// import type {ViewProps} from 'react-native';
import {requireNativeComponent, type ViewProps} from 'react-native';
import type {
Float,
Int32,
WithDefault
} from 'react-native/Libraries/Types/CodegenTypes';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
// import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

export interface HighlightFrame {
x: Float;
Expand Down Expand Up @@ -32,46 +33,50 @@ export interface NativeProps extends ViewProps {
* The frame to highlight with x, y, width, height coordinates
*/
highlightFrame?: HighlightFrame;

/**
* The overlay color (processed color int for Android)
*/
overlayColor?: WithDefault<Int32, 0>;

/**
* The border radius for the highlighted area
*/
borderRadius?: WithDefault<Float, 0>;

/**
* The stroke color (processed color int for Android)
*/
strokeColor?: WithDefault<Int32, 0>;

/**
* The stroke width
*/
strokeWidth?: WithDefault<Float, 0>;

/**
* The React tag of the view to highlight
*/
highlightViewTag?: Int32;

/**
* Parameters for view-based highlighting including padding and offset
*/
highlightViewTagParams?: HighlightViewTagParams;

/**
* Minimum rectangle size for the highlight area
*/
minimumRectSize?: MinimumRectSize;

/**
* Inner padding for the highlight area
*/
innerPadding?: WithDefault<Float, 0>;
}

export default codegenNativeComponent<NativeProps>('HighlighterView');
// export default codegenNativeComponent<NativeProps>('HighlighterView');

const HighlighterViewNativeComponent = requireNativeComponent<NativeProps>('HighlighterView');

export default HighlighterViewNativeComponent;
Original file line number Diff line number Diff line change
@@ -1,72 +1,74 @@
import type {ViewProps} from 'react-native';
import type {
Int32,
WithDefault
} from 'react-native/Libraries/Types/CodegenTypes';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
// import type {ViewProps} from 'react-native';
import {requireNativeComponent, type ViewProps} from 'react-native';
import type {Int32, WithDefault} from 'react-native/Libraries/Types/CodegenTypes';
// import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';

export interface NativeProps extends ViewProps {
/**
* Enables tracking of the keyboard when it's dismissed interactively (false by default).
*/
trackInteractive?: WithDefault<boolean, false>;

/**
* iOS only.
* Show the keyboard on a negative scroll
*/
revealKeyboardInteractive?: WithDefault<boolean, false>;

/**
* iOS only.
* Set to false to turn off inset management and manage it yourself
*/
manageScrollView?: WithDefault<boolean, true>;

/**
* iOS only.
* Set to true manageScrollView is set to true and still does not work
*/
requiresSameParentToManageScrollView?: WithDefault<boolean, false>;

/**
* iOS only.
* Allow hitting sub-views that are placed beyond the view bounds
*/
allowHitsOutsideBounds?: WithDefault<boolean, false>;

/**
* Should the scrollView scroll to the focused input
*/
scrollToFocusedInput?: WithDefault<boolean, false>;

/**
* iOS only.
* The scrolling behavior (NONE | SCROLL_TO_BOTTOM_INVERTED_ONLY | FIXED_OFFSET)
*/
scrollBehavior?: WithDefault<Int32, 0>;

/**
* iOS only.
* Add a SafeArea view beneath the KeyboardAccessoryView
*/
addBottomView?: WithDefault<boolean, false>;

/**
* iOS only.
* The bottom view's color
*/
bottomViewColor?: string;

/**
* Allow control safe area
*/
useSafeArea?: WithDefault<boolean, false>;

/**
* Whether or not to include bottom tab bar inset
*/
usesBottomTabs?: WithDefault<boolean, false>;
}

export default codegenNativeComponent<NativeProps>('KeyboardTrackingViewTemp');
// export default codegenNativeComponent<NativeProps>('KeyboardTrackingViewTemp');

const KeyboardTrackingViewNativeComponent = requireNativeComponent<NativeProps>('KeyboardTrackingViewTemp');

export default KeyboardTrackingViewNativeComponent;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"react-native-redash": "^12.0.3",
"semver": "^5.5.0",
"tinycolor2": "^1.4.2",
"uilib-native": "5.0.0-snapshot.7204",
"uilib-native": "5.0.0-snapshot.7207",
"url-parse": "^1.2.0",
"wix-react-native-text-size": "1.0.9"
},
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10928,7 +10928,7 @@ __metadata:
shell-utils: ^1.0.10
tinycolor2: ^1.4.2
typescript: 5.0.4
uilib-native: 5.0.0-snapshot.7204
uilib-native: 5.0.0-snapshot.7207
url-parse: ^1.2.0
wix-react-native-text-size: 1.0.9
peerDependencies:
Expand Down Expand Up @@ -12560,16 +12560,16 @@ __metadata:
languageName: node
linkType: hard

"uilib-native@npm:5.0.0-snapshot.7204":
version: 5.0.0-snapshot.7204
resolution: "uilib-native@npm:5.0.0-snapshot.7204"
"uilib-native@npm:5.0.0-snapshot.7207":
version: 5.0.0-snapshot.7207
resolution: "uilib-native@npm:5.0.0-snapshot.7207"
dependencies:
lodash: ^4.17.21
prop-types: ^15.5.10
peerDependencies:
react: ">=17.0.1"
react-native: ">=0.64.1"
checksum: 9f922ec1e91d2f1609930e932b182ea48b03b07c2c79ef61569a1277be4120d6434782e91874a058998b5703dff53a94c2a504142066812489c915a2a8c24820
checksum: 3246a839f411acc4b05507eb3f1c1eea350b38268c8167e68fe6ca123985a53b848578df33bf738aee230cd2ef535bc41bd975d1e1f848e7263ff59ee7ae04e9
languageName: node
linkType: hard

Expand Down