Closed talves closed 3 years ago
Allow for automatic jsx transform (react/jsx-runtime) react component libraries to alias to the preact/jsx-runtime.
automatic
react/jsx-runtime
preact/jsx-runtime
export function Hello() { return <div>Hello</div>; }
compiles to:
import { jsx } from "react/jsx-runtime"; export function Hello() { return /*#__PURE__*/jsx ("div", { children: "Hello" }); }
The alternative to the automatic is classic which uses React.createElement and this is currently handled with the react: "preact/compat" alias.
classic
React.createElement
react: "preact/compat"
import React from "react"; export function Hello() { return /*#__PURE__*/React.createElement("div", null, "Hello"); }
Allow for
automatic
jsx transform (react/jsx-runtime
) react component libraries to alias to thepreact/jsx-runtime
.compiles to:
The alternative to the
automatic
isclassic
which usesReact.createElement
and this is currently handled with thereact: "preact/compat"
alias.compiles to: