-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
how do I enable JSX syntax for .js extensions? #230
Comments
Thanks for reporting; this is one of the common challenges we faced while letting Vite support packages built for RN since RN there's only Metro, and Metro is very tolerant of things such as putting JSX syntax inside We're trying to find a better solution (especially with Rolldown), but in the meanwhile, a way to work around this is to define package patches in your // vite.config.ts
export default {
plugins: [
one({
// ...
deps: {
'react-native-vector-icons': {
'**/*.js': [
'jsx', // Transpile JSX in .js files
'flow', // Remove flow types
],
},
},
}),
],
} Unfortunately, this still can't make |
I got Basically we'll need to also include |
Also tried FontAwesome but perhaps that font is not included in Expo Go and icons didn't show on native. |
How do I enable JSX syntax for .js extension.
I'm trying react-native-paper but getting compilation error. Is there an official doc on how to do this via vite config or some other settings?
The text was updated successfully, but these errors were encountered: