Skip to content

Commit

Permalink
fix(Android): change name of headerBackButtonClicked event (#2015)
Browse files Browse the repository at this point in the history
## Description

When running app, there is a soft error thrown with such message:

![image](https://github.com/software-mansion/react-native-screens/assets/32481228/47285229-ca19-438d-bca1-9f93187108bf)
and it is true that only this event does not stick to the convention, so
we should change it.

## Changes

Removed `Event` suffix in `topHeaderBackButtonClickedEvent` since it
should not be there.

---------

Co-authored-by: Tymoteusz Boba <Tymoteusz.Boba@gmail.com>
  • Loading branch information
WoLewicki and tboba authored Jan 18, 2024
1 parent db3124e commit d28a1f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class HeaderBackButtonClickedEvent(surfaceId: Int, viewId: Int) : Event<ScreenAp
override fun getEventData(): WritableMap? = Arguments.createMap()

companion object {
const val EVENT_NAME = "topHeaderBackButtonClickedEvent"
const val EVENT_NAME = "topHeaderBackButtonClicked"
}
}
2 changes: 1 addition & 1 deletion src/fabric/ScreenNativeComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export interface NativeProps extends ViewProps {
onHeaderHeightChange?: BubblingEventHandler<HeaderHeightChangeEvent>;
onTransitionProgress?: BubblingEventHandler<TransitionProgressEvent>;
onGestureCancel?: BubblingEventHandler<ScreenEvent>;
onHeaderBackButtonClicked?: BubblingEventHandler<ScreenEvent>;
sheetAllowedDetents?: WithDefault<SheetDetentTypes, 'large'>;
sheetLargestUndimmedDetent?: WithDefault<SheetDetentTypes, 'all'>;
sheetGrabberVisible?: WithDefault<boolean, false>;
Expand Down Expand Up @@ -96,7 +97,6 @@ export interface NativeProps extends ViewProps {
navigationBarColor?: ColorValue;
navigationBarHidden?: boolean;
nativeBackButtonDismissalEnabled?: boolean;
onHeaderBackButtonClicked?: BubblingEventHandler<ScreenEvent>;
}

export default codegenNativeComponent<NativeProps>('RNSScreen', {
Expand Down

0 comments on commit d28a1f7

Please sign in to comment.