We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.2.4
Darwin 24.3.0 x86_64 i386
index.jsx
function createElement(type, props, ...children) { console.log("MyReact.createElement called"); return { type, props: { ...props, children, }, }; } const MyReact = { createElement, }; const element = ( <div id="foo"> <h1>Hello MyReact</h1> </div> ); console.log(element);
bunfig.toml
jsx = "react" jsxFactory = "MyReact.createElement"
index.html
<!DOCTYPE html> <html lang=en> <head> <title>Learn React</title> <script src="./index.jsx" type="module"></script> </head> <body> <div id="root"></div> </body> </html>
Everything works as expected When I use bun run index.jsx and bun build index.html --outdir out
bun run index.jsx
bun build index.html --outdir out
The jsxFactory is ignored when I use bun index.html
jsxFactory
bun index.html
The output of the build is correct.
function createElement(type, props, ...children) { console.log("MyReact.createElement called"); return { type, props: { ...props, children } }; } var MyReact = { createElement }; var element = /* @__PURE__ */ MyReact.createElement("div", { id: "foo" }, /* @__PURE__ */ MyReact.createElement("h1", null, "Hello MyReact")); console.log(element);
But the HTML version prints the ReactElement, which means it is still using React.createElement.
ReactElement
React.createElement
It still not works if I use the output of the build. Which can be reproduced by the following steps
$ bun build index.html --outdir out $ cd out && bun index.html
Both dev and production build ignore the JSX config.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of Bun is running?
1.2.4
What platform is your computer?
Darwin 24.3.0 x86_64 i386
What steps can reproduce the bug?
index.jsx
bunfig.toml
index.html
What is the expected behavior?
Everything works as expected When I use
bun run index.jsx
andbun build index.html --outdir out
The
jsxFactory
is ignored when I usebun index.html
What do you see instead?
The output of the build is correct.
But the HTML version prints the
ReactElement
, which means it is still usingReact.createElement
.Additional information
It still not works if I use the output of the build.
Which can be reproduced by the following steps
Both dev and production build ignore the JSX config.
The text was updated successfully, but these errors were encountered: