Skip to content

Commit

Permalink
chore: Switch React API from v17 to v18 (#168)
Browse files Browse the repository at this point in the history
* (fix): Switch React API from v17 to v18

* Update src/ui.tsx

---------

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
  • Loading branch information
alexrudd2 and nornagon authored Jul 12, 2023
1 parent 33fbd4f commit 42bee3a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ui.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import useComponentSize from "@rehooks/component-size";
import React, { ChangeEvent, Fragment, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, useReducer } from "react";
import ReactDOM from "react-dom";
import { createRoot } from 'react-dom/client';
import interpolator from "color-interpolate"
import colormap from "colormap"

Expand Down Expand Up @@ -1190,7 +1190,8 @@ function DragTarget() {
</div>;
}

ReactDOM.render(<Root />, document.getElementById("app"));
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
createRoot(document.getElementById("app")!).render(<Root />);

function withSVG<T>(svgString: string, fn: (svg: SVGSVGElement) => T): T {
const div = document.createElement("div");
Expand Down

0 comments on commit 42bee3a

Please sign in to comment.