Skip to content

feat: enhance BottomSheetModal mock, add createBottomSheetScrollableC… #2265

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gabimoncha
Copy link

This PR enhances the current mock file by adding:

  • BottomSheetModal mock with renderProp pattern
  • createBottomSheetScrollableComponent mock
  • enum mocks

Motivation

Jest fails with the current implementation of BottomSheetModal when using renderProp to pass the present data in the Content, with the following error

Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
          at BottomSheetModal (/Users/gabimoncha/Documents/second-brain/node_modules/@gorhom/bottom-sheet/mock.js:27:23)
<BottomSheetModal ref={frequencyPickerModalRef}>
	{({ data }) => <Content data={data} />}
</BottomSheetModal>

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