We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f171d19 commit c1d9bfbCopy full SHA for c1d9bfb
.github/workflows/ci.yml
@@ -35,4 +35,4 @@ jobs:
35
run: npm i react@${{ matrix.react }} react-dom@${{ matrix.react }}
36
37
- name: Run tests on React ${{ matrix.react }}
38
- run: npm test
+ run: REACT_VERSION=${{ matrix.react }} npm test
public/index.js
@@ -1,9 +1,14 @@
1
import React from 'react';
2
import ReactDOM from 'react-dom';
3
-import { createRoot } from 'react-dom/client';
4
5
import syntaxHighlighter, { cmVariableContext } from '../src/index';
6
+let createRoot;
7
+if (process.env.REACT_VERSION === '18') {
8
+ // eslint-disable-next-line global-require
9
+ ({ createRoot } = require('react-dom/client'));
10
+}
11
+
12
const exampleCode = `curl --request POST
13
--url <<url>>
14
--header 'authorization: Bearer 123'
0 commit comments