Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork908
fix: replace JSX withReact.createElementin mock implementation#2302
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
React.createElementin mock implementationReact.createElementin mock implementationmy bad, i missed this. cc@gorhom |
AlixH commentedJul 11, 2025
Up |
jerone commentedJul 27, 2025
Easy fix. 🚀 |
425b6ec toa123b17Comparerokkoo commentedAug 28, 2025
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. |
jerone commentedSep 28, 2025
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 |
Uh oh!
There was an error while loading.Please reload this page.
Motivation
Fixing mock from#2265
Problem
The mock implementation in mock.js was using JSX syntax (
<Content data={this.data} />), which caused aSyntaxError: Unexpected token '<'on some projects.This forces users to add
@gorhom/bottom-sheetto their JesttransformIgnorePatternsconfiguration to enable JSX transformation for the mock file: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