fix: replace JSX with `React.createElement`in mock implementation
Motivation
Fixing mock from https://github.com/gorhom/react-native-bottom-sheet/pull/2265
Problem
The mock implementation in mock.js was using JSX syntax (<Content data={this.data} />), which caused a SyntaxError: Unexpected token '<' on some projects.
This forces users to add @gorhom/bottom-sheet to their Jest transformIgnorePatterns configuration to enable JSX transformation for the mock file:
transformIgnorePatterns: [
"node_modules/(?!@gorhom/bottom-sheet|...other packages)"
]
Solution:
Replaced JSX syntax with React.createElement(Content, { data: this.data }) in the BottomSheetModal mock component.
This ensures the mock works in all JavaScript environments without requiring JSX transformation
my bad, i missed this. cc @gorhom
Up
Easy fix. 🚀
This works fine!
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.
Still relevant. 👍
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.
don't stale it, cc @gorhom this should be an ez merge