mirror of
https://github.com/apricote/Listory.git
synced 2026-02-06 17:57:03 +00:00
chore(deps): update react monorepo to v18
This commit is contained in:
parent
ca09d6b49e
commit
8e0b38b9b3
6 changed files with 1382 additions and 6032 deletions
7389
frontend/package-lock.json
generated
7389
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -10,7 +10,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fullhuman/postcss-purgecss": "4.1.3",
|
"@fullhuman/postcss-purgecss": "4.1.3",
|
||||||
"@testing-library/jest-dom": "5.16.4",
|
"@testing-library/jest-dom": "5.16.4",
|
||||||
"@testing-library/react": "12.1.5",
|
"@testing-library/react": "13.3.0",
|
||||||
"@testing-library/user-event": "14.2.1",
|
"@testing-library/user-event": "14.2.1",
|
||||||
"@types/jest": "27.5.2",
|
"@types/jest": "27.5.2",
|
||||||
"@types/node": "15.6.0",
|
"@types/node": "15.6.0",
|
||||||
|
|
@ -26,8 +26,8 @@
|
||||||
"postcss-cli": "9.1.0",
|
"postcss-cli": "9.1.0",
|
||||||
"postcss-import": "14.1.0",
|
"postcss-import": "14.1.0",
|
||||||
"prettier": "2.7.1",
|
"prettier": "2.7.1",
|
||||||
"react": "17.0.2",
|
"react": "18.2.0",
|
||||||
"react-dom": "17.0.2",
|
"react-dom": "18.2.0",
|
||||||
"react-router-dom": "6.3.0",
|
"react-router-dom": "6.3.0",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"recharts": "2.1.11",
|
"recharts": "2.1.11",
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ const NavUserInfo: React.FC<{ user: User }> = ({ user }) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const NavItem: React.FC = ({ children }) => {
|
const NavItem: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
||||||
return (
|
return (
|
||||||
<span className="block mt-4 lg:inline-block lg:mt-0 text-green-200 hover:text-white mr-4">
|
<span className="block mt-4 lg:inline-block lg:mt-0 text-green-200 hover:text-white mr-4">
|
||||||
{children}
|
{children}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ const apiClientContext = createContext<ApiClientContext>(
|
||||||
undefined as any as ApiClientContext
|
undefined as any as ApiClientContext
|
||||||
);
|
);
|
||||||
|
|
||||||
export const ProvideApiClient: React.FC = ({ children }) => {
|
export const ProvideApiClient: React.FC<{ children: React.ReactNode }> = ({
|
||||||
|
children,
|
||||||
|
}) => {
|
||||||
const auth = useProvideApiClient();
|
const auth = useProvideApiClient();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@ interface AuthContext {
|
||||||
|
|
||||||
const authContext = createContext<AuthContext>(undefined as any as AuthContext);
|
const authContext = createContext<AuthContext>(undefined as any as AuthContext);
|
||||||
|
|
||||||
export const ProvideAuth: React.FC = ({ children }) => {
|
export const ProvideAuth: React.FC<{ children: React.ReactNode }> = ({
|
||||||
|
children,
|
||||||
|
}) => {
|
||||||
const auth = useProvideAuth();
|
const auth = useProvideAuth();
|
||||||
|
|
||||||
return <authContext.Provider value={auth}>{children}</authContext.Provider>;
|
return <authContext.Provider value={auth}>{children}</authContext.Provider>;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ReactDOM from "react-dom";
|
|
||||||
import { BrowserRouter } from "react-router-dom";
|
import { BrowserRouter } from "react-router-dom";
|
||||||
|
import { createRoot } from "react-dom/client";
|
||||||
import { App } from "./App";
|
import { App } from "./App";
|
||||||
import { ProvideApiClient } from "./hooks/use-api-client";
|
import { ProvideApiClient } from "./hooks/use-api-client";
|
||||||
import { ProvideAuth } from "./hooks/use-auth";
|
import { ProvideAuth } from "./hooks/use-auth";
|
||||||
import * as serviceWorker from "./serviceWorker";
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
|
||||||
ReactDOM.render(
|
const root = createRoot(document.getElementById("root")!);
|
||||||
|
|
||||||
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<ProvideAuth>
|
<ProvideAuth>
|
||||||
<ProvideApiClient>
|
<ProvideApiClient>
|
||||||
|
|
@ -15,8 +17,7 @@ ReactDOM.render(
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</ProvideApiClient>
|
</ProvideApiClient>
|
||||||
</ProvideAuth>
|
</ProvideAuth>
|
||||||
</React.StrictMode>,
|
</React.StrictMode>
|
||||||
document.getElementById("root")
|
|
||||||
);
|
);
|
||||||
|
|
||||||
serviceWorker.unregister();
|
serviceWorker.unregister();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue