#Figuring a JSX Error

1 messages · Page 1 of 1 (latest)

modern gyro
#

Hello, Actually I'm trying to Build a simple application using Vite+React, also I use UI Lib called RNR link : https://github.com/mrzachnugent/react-native-reusables (Working for mobile and the web on the same time). I'm figuring this issue when I try to serve the application

✘ [ERROR] The JSX syntax extension is not currently enabled

    node_modules/@rn-primitives/slot/dist/index.mjs:15:57:
      15 │     return React.cloneElement(isTextChildren(children) ? <></> : children, {
         ╵                                                          ^

  The esbuild loader for this file is currently set to "js" but it must be set to "jsx" to be able
  to parse JSX syntax. You can use "loader: { '.js': 'jsx' }" to do that.

Here is my vite config :

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import reactNativeWeb from "vite-plugin-react-native-web";

// https://vite.dev/config/

export default defineConfig({
  plugins: [
    react(),
    reactNativeWeb()
  ],
})

There is any configuration to add to the vite.config.ts ?

Thanks for your help guys.

GitHub

Universal shadcn/ui for React Native featuring a focused collection of components - Crafted with NativeWind v4 and accessibility in mind. - mrzachnugent/react-native-reusables

simple river
#

I am not at all familiar with React Native, but it seems like the error is because the plugin you're using have JSX content inside normal JS file