Skip to content

Conversation

huextrat
Copy link

@huextrat huextrat commented Jun 4, 2025

Motivation

Fixing mock from #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

@huextrat huextrat changed the title Fix: replace JSX with React.createElementin mock implementation fix: replace JSX with React.createElementin mock implementation Jun 4, 2025
@gabimoncha
Copy link
Contributor

my bad, i missed this. cc @gorhom

@AlixH
Copy link

AlixH commented Jul 11, 2025

Up

@jerone
Copy link

jerone commented Jul 27, 2025

Easy fix. 🚀

@gorhom gorhom force-pushed the master branch 2 times, most recently from 425b6ec to a123b17 Compare August 17, 2025 21:39
@rokkoo
Copy link

rokkoo commented Aug 28, 2025

This works fine!

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.

5 participants