Skip to content

Commit

Permalink
Add ESM note
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-kinokon committed Dec 22, 2024
1 parent 6737229 commit 81077d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ pnpm add jsx-dom

## Usage

`jsx-dom` is ESM only. If you need CommonJS support, install `jsx-dom-cjs` instead. These two packages only differ in module format.
`jsx-dom` is ESM only.

If you need CommonJS support, you can

1. Use this library directly if you use [Node v22](https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require) or above.
2. install `jsx-dom-cjs` instead. These two packages only differ in module format.

**Note:** If you are using [React Automatic Runtime](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx), simply set `jsxImportSource` to `jsx-dom` or `jsx-dom/min` and you can omit the import.

Expand Down

0 comments on commit 81077d5

Please sign in to comment.