mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +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
|
|
@ -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 (
|
||||
<span className="block mt-4 lg:inline-block lg:mt-0 text-green-200 hover:text-white mr-4">
|
||||
{children}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ const apiClientContext = createContext<ApiClientContext>(
|
|||
undefined as any as ApiClientContext
|
||||
);
|
||||
|
||||
export const ProvideApiClient: React.FC = ({ children }) => {
|
||||
export const ProvideApiClient: React.FC<{ children: React.ReactNode }> = ({
|
||||
children,
|
||||
}) => {
|
||||
const auth = useProvideApiClient();
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@ interface 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();
|
||||
|
||||
return <authContext.Provider value={auth}>{children}</authContext.Provider>;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { BrowserRouter } from "react-router-dom";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { App } from "./App";
|
||||
import { ProvideApiClient } from "./hooks/use-api-client";
|
||||
import { ProvideAuth } from "./hooks/use-auth";
|
||||
import * as serviceWorker from "./serviceWorker";
|
||||
|
||||
ReactDOM.render(
|
||||
const root = createRoot(document.getElementById("root")!);
|
||||
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<ProvideAuth>
|
||||
<ProvideApiClient>
|
||||
|
|
@ -15,8 +17,7 @@ ReactDOM.render(
|
|||
</BrowserRouter>
|
||||
</ProvideApiClient>
|
||||
</ProvideAuth>
|
||||
</React.StrictMode>,
|
||||
document.getElementById("root")
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
serviceWorker.unregister();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue