Skip to content

Commit

Permalink
[React] Update to v18 syntax
Browse files Browse the repository at this point in the history
Updated after seeing a linter deprecation warning, using this guide:
https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
  • Loading branch information
werkshy committed Aug 1, 2023
1 parent d2ef32e commit cf6002c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions react/src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { render } from "react-dom";
import { createRoot } from "react-dom/client";
import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";

import { Playlist } from "./playlist";
Expand Down Expand Up @@ -30,9 +30,10 @@ function App() {
);
}

render(
const container = document.getElementById("index");
const root = createRoot(container);
root.render(
<BrowserRouter>
<App />
</BrowserRouter>,
document.getElementById("index"),
);

0 comments on commit cf6002c

Please sign in to comment.