Skip to content

fix(ios): set default props for the bottom accessory view - #614

Open
oleksandrzavarzin-callstack wants to merge 1 commit into
callstack:mainfrom
oleksandrzavarzin-callstack:fix/607-bottom-accessory-props
Open

oleksandrzavarzin-callstack wants to merge 1 commit into
callstack:mainfrom
oleksandrzavarzin-callstack:fix/607-bottom-accessory-props

Conversation

@oleksandrzavarzin-callstack

Copy link
Copy Markdown
Contributor

Summary

Fixes #607.
In Debug builds on iOS 26+, any TabView with renderBottomAccessoryView crashed on first render:

RCTViewComponentView subclasses (and RCTBottomAccessoryComponentView particularly) must setup _props instance variable with a default value in the constructor.

RCTBottomAccessoryComponentView created defaultProps in initWithFrame: but never assigned it to _props.
This PR assigns it, as RCTTabViewComponentView already does.

Results

iOS 26.5 iOS 27.0
Example app, main crash on "Bottom Accessory View" crash on "Bottom Accessory View"
Example app, this PR accessory shows accessory shows
React Native 0.88 test app, 1.5.0 crash crash
React Native 0.88 test app, with the fix accessory shows accessory shows

Videos

Example app, iOS 26.5

Before After
XuPPM3MoejA0MMg-PUb8_w.mp4
yHo9TqMDazi5bqBkczX1bA.mp4

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

renderBottomAccessoryView crashes on iOS 26: RCTBottomAccessoryComponentView does not initialize _props in its constructor

1 participant