Skip to content

fix: invoke render function children instead of rendering as JSX component#2636

Open
linkeryoon wants to merge 1 commit intogorhom:masterfrom
linkeryoon:fix/modal-children-render-function
Open

fix: invoke render function children instead of rendering as JSX component#2636
linkeryoon wants to merge 1 commit intogorhom:masterfrom
linkeryoon:fix/modal-children-render-function

Conversation

@linkeryoon
Copy link
Copy Markdown

Summary

This reverts the regression introduced during the v5 migration, where Content({ data }) was changed back to <Content data={data} />.

This fix was originally introduced in #1750 but was lost during the v5 codebase migration.

Problem

As data is an object, rendering <Content data={data} /> creates unnecessary re-renders due to unstable function references. Invoking Content({ data }) directly avoids this issue.

Solution

- {typeof Content === 'function' ? <Content data={data} /> : Content}
+ {typeof Content === 'function' ? Content({ data }) : Content}

…onent

This reverts the regression introduced during the v5 migration,
where Content({ data }) was changed back to <Content data={data} />.

Originally fixed in gorhom#1750 but lost during the v5 codebase migration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TwanLuttik added a commit to TwanLuttik/react-native-bottom-sheet that referenced this pull request Apr 8, 2026
- Replace deprecated Animated.AnimateProps with AnimatedProps (fixes reanimated v4 compatibility)
- Fix onScroll prop being incorrectly omitted from BottomSheetFlatListProps types
- Invoke render function children directly instead of as JSX component to avoid unnecessary re-renders
- Inline FlashListProps type to remove @shopify/flash-list type dependency

Fixes: gorhom#2524, gorhom#2629, gorhom#2636, gorhom#2620
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.

1 participant