The problem was somewhat simple and wierd, my react file had an import statements looking like these :-
import * as react from "react";
while the esbuild compiled the jsx to React.createElement(...)
, noticing that my imports declared 'react' with smallcase 'r' while the jsx was transpiled with React.createElement
with uppercase 'R'.
Fixing my imports to have a uppercase 'R' fixed the issue. Looks like esbuild doesn't look at the react imports while transpiling jsx.