Skip to content

Converting MDX to CJS for React Native can be challenging due to compatibility issues. #2450

Answered by ChristianMurphy
zfben asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @zfben! 👋
Sorry you ran into some confusion.

Taking a few steps back, setting aside the build questions.
MDX compiles to HTML tags by default, React Native does not support HTML tags.
You need something like https://github.com/danieldunderfelt/rn-mdx which translates the web elements into their React native equivalent.

Back to your build tool question, ESM and node built in are standard, they're supported by build tools.
Expo and react-native/babel-preset automatically take care of this for you, make sure you have one or both enabled https://reactnative.dev/docs/next/javascript-environment#javascript-syntax-transformers
If you still see an issue consider raising with the issue with yo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@zfben
Comment options

Answer selected by zfben
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants