Skip to content
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

fix: add children to BottomSheetModal containerComponent type #1971

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

Nodonisko
Copy link
Contributor

@Nodonisko Nodonisko commented Oct 14, 2024

Motivation

children as default prop of React.FC was removed in React 18 so it needs to be explicitly defined. Otherwise this code throws error:

        <BottomSheetModal
             {...otherProps}
            // this will throw TS error
            containerComponent={({ children }) => <WindowOverlay>{children}</WindowOverlay>}
        >

@gorhom
Copy link
Owner

gorhom commented Oct 14, 2024

thanks @Nodonisko for submitting this PR, i think it would be better to use

  containerComponent?: React.ComponentType<React.PropsWithChildren>;

wdyt ?

@Nodonisko Nodonisko force-pushed the fix/bottom-sheet-modal-types branch from 01f3fac to a29010c Compare October 15, 2024 18:11
@Nodonisko
Copy link
Contributor Author

Sounds better, fixed.

@gorhom gorhom merged commit 203e52f into gorhom:master Oct 15, 2024
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.

2 participants