Skip to content

Commit

Permalink
fix(iOS): add canCoalesce method to RNSHeaderHeightChangeEvent (#1933)
Browse files Browse the repository at this point in the history
## Description

It looks like when I was implementing class that is representing the
`onHeaderHeightChange` I made a mistake and I forgot / accidentally
removed `canCoalesce` method which led to displaying
`RNSHeaderHeightChangeEvent: unrecognized selector sent to instance` for
a couple of users.

This issue resolves that error by adding `canCoalesce` method to the
event.
Fixes #1932.

## Changes

- Added `canCoalesce` method to `RNSHeaderHeightChangeEvent` file

## Test code and steps to reproduce

You can test the changes by checking `Test1802.tsx` component in
FabricTestExample.

## Checklist

- [ ] Ensured that CI passes
  • Loading branch information
tboba authored Oct 23, 2023
1 parent d3035e5 commit b6db977
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ios/events/RNSHeaderHeightChangeEvent.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ - (NSDictionary *)body
return body;
}

- (BOOL)canCoalesce
{
return YES;
}

- (uint16_t)coalescingKey
{
return _headerHeight;
}

- (id<RCTEvent>)coalesceWithEvent:(id<RCTEvent>)newEvent
{
return newEvent;
}

+ (NSString *)moduleDotMethod
{
return @"RCTEventEmitter.receiveEvent";
Expand Down

0 comments on commit b6db977

Please sign in to comment.