diff --git a/components/Editor/Header.tsx b/components/Editor/Header.tsx index 7cd099e..5d0e6f7 100644 --- a/components/Editor/Header.tsx +++ b/components/Editor/Header.tsx @@ -1,4 +1,4 @@ -import { useMemo } from 'react' +import { useMemo, useId } from 'react' import Select, { OnChangeValue } from 'react-select' @@ -37,7 +37,7 @@ const EditorHeader = ({ codeType, onCodeTypeChange }: Props) => { isSearchable={false} classNamePrefix="select" menuPlacement="auto" - instanceId="headerSelect" + instanceId={useId()} /> diff --git a/components/layouts/Home.tsx b/components/layouts/Home.tsx index 1935cc8..95067a9 100644 --- a/components/layouts/Home.tsx +++ b/components/layouts/Home.tsx @@ -1,3 +1,5 @@ +import { PropsWithChildren } from 'react' + import { GoogleAnalytics } from '@next/third-parties/google' import type { NextPage } from 'next' import Head from 'next/head' @@ -7,7 +9,7 @@ import { getAbsoluteURL } from 'util/browser' import Footer from './Footer' import Nav from './Nav' -const HomeLayout: NextPage = ({ children }) => { +const HomeLayout: NextPage = ({ children }) => { return ( <> diff --git a/components/ui/Input.tsx b/components/ui/Input.tsx index 2d2ba6a..8dd3522 100644 --- a/components/ui/Input.tsx +++ b/components/ui/Input.tsx @@ -4,12 +4,11 @@ import cn from 'classnames' type Props = { searchable?: boolean - ref?: ForwardedRef rightIcon?: JSX.Element className?: string inputClassName?: string readOnly?: boolean -} & React.ComponentPropsWithoutRef<'input'> +} & React.ComponentProps<'input'> export const Input: React.FC = forwardRef( ( diff --git a/context/appUiContext.tsx b/context/appUiContext.tsx index 0849e98..4d6a2b1 100644 --- a/context/appUiContext.tsx +++ b/context/appUiContext.tsx @@ -1,4 +1,4 @@ -import React, { createContext, useState } from 'react' +import React, { PropsWithChildren, createContext, useState } from 'react' export enum LogType { Error, @@ -31,7 +31,7 @@ export const AppUiContext = createContext({ addToConsoleLog: () => undefined, }) -export const AppUiProvider: React.FC = ({ children }) => { +export const AppUiProvider: React.FC = ({ children }) => { const [isFullScreen, setIsFullScreen] = useState(false) const [consoleLog, setConsoleLog] = useState([ { diff --git a/context/cairoVMApiContext.tsx b/context/cairoVMApiContext.tsx index 44ea9ce..8d502f3 100644 --- a/context/cairoVMApiContext.tsx +++ b/context/cairoVMApiContext.tsx @@ -1,4 +1,4 @@ -import React, { createContext, useState } from 'react' +import React, { PropsWithChildren, createContext, useState } from 'react' import { IInstruction, ILogEntry } from 'types' @@ -74,7 +74,9 @@ export const CairoVMApiContext = createContext({ removeBreakPoint: noOp, }) -export const CairoVMApiProvider: React.FC = ({ children }) => { +export const CairoVMApiProvider: React.FC = ({ + children, +}) => { const [sierraCode, setSierraCode] = useState('') const [casmCode, setCasmCode] = useState('') const [casmInstructions, setCasmInstructions] = useState([]) diff --git a/context/settingsContext.tsx b/context/settingsContext.tsx index 4476cf7..5c38a4e 100644 --- a/context/settingsContext.tsx +++ b/context/settingsContext.tsx @@ -1,4 +1,9 @@ -import React, { createContext, useEffect, useState } from 'react' +import React, { + PropsWithChildren, + createContext, + useEffect, + useState, +} from 'react' const LOCAL_SETTINGS_KEY = 'cairovmcodes_settings' @@ -23,7 +28,7 @@ export const SettingsContext = createContext({ setSetting: () => null, }) -export const SettingsProvider: React.FC<{}> = ({ children }) => { +export const SettingsProvider: React.FC = ({ children }) => { const [settings, setSettings] = useState({}) const [settingsLoaded, setSettingsLoaded] = useState(false) diff --git a/package-lock.json b/package-lock.json index 1481ca3..48199a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "lodash.debounce": "^4.0.8", "next": "13", "next-mdx-remote": "^4.4.1", - "next-themes": "^0.0.15", + "next-themes": "^0.1.1", "process": "^0.11.10", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -49,7 +49,7 @@ "@types/js-cookie": "^3.0.1", "@types/lodash.debounce": "^4.0.6", "@types/mdx-js__react": "^1.5.5", - "@types/react": "17.0.30", + "@types/react": "^18.2.67", "@types/react-table": "^7.7.6", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", @@ -3179,8 +3179,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "17.0.30", - "license": "MIT", + "version": "18.2.67", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.67.tgz", + "integrity": "sha512-vkIE2vTIMHQ/xL0rgmuoECBCkZFZeHr49HeWSc24AptMbNRo7pwSBvj73rlJJs9fGKj0koS+V7kQB1jHS0uCgw==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -9639,10 +9640,11 @@ } }, "node_modules/next-themes": { - "version": "0.0.15", - "license": "MIT", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.1.1.tgz", + "integrity": "sha512-Iqxt6rhS/KfK/iHJ0tfFjTcdLEAI0AgwFuAFrMwLOPK5e+MI3I+fzyvBoS+VaOS+NldUiazurhgwYhrfV0VXsQ==", "peerDependencies": { - "next": "*", + "next": ">=11.1.1", "react": "*", "react-dom": "*" } diff --git a/package.json b/package.json index afd1c08..def8782 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "lodash.debounce": "^4.0.8", "next": "13", "next-mdx-remote": "^4.4.1", - "next-themes": "^0.0.15", + "next-themes": "^0.1.1", "process": "^0.11.10", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -57,7 +57,7 @@ "@types/js-cookie": "^3.0.1", "@types/lodash.debounce": "^4.0.6", "@types/mdx-js__react": "^1.5.5", - "@types/react": "17.0.30", + "@types/react": "^18.2.67", "@types/react-table": "^7.7.6", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", diff --git a/pages/about.tsx b/pages/about.tsx index 7970e04..67ad819 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -1,6 +1,5 @@ -import React from 'react' +import React, { ReactNode } from 'react' -import type { NextPage } from 'next' import Head from 'next/head' import HomeLayout from 'components/layouts/Home' @@ -513,7 +512,7 @@ const AboutPage = () => { ) } -AboutPage.getLayout = function getLayout(page: NextPage) { +AboutPage.getLayout = function getLayout(page: ReactNode) { return {page} } diff --git a/pages/index.tsx b/pages/index.tsx index 1071c3b..2050bfa 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,6 +1,5 @@ -import { useContext } from 'react' +import { ReactNode, useContext } from 'react' -import type { NextPage } from 'next' import Head from 'next/head' import { AppUiContext } from 'context/appUiContext' @@ -37,7 +36,7 @@ const HomePage = () => { ) } -HomePage.getLayout = function getLayout(page: NextPage) { +HomePage.getLayout = function getLayout(page: ReactNode) { return {page} } diff --git a/pages/playground.tsx b/pages/playground.tsx index 4399061..0864bb3 100644 --- a/pages/playground.tsx +++ b/pages/playground.tsx @@ -1,4 +1,5 @@ -import type { NextPage } from 'next' +import { ReactNode } from 'react' + import Head from 'next/head' import Editor from 'components/Editor' @@ -25,7 +26,7 @@ const PlaygroundPage = () => { ) } -PlaygroundPage.getLayout = function getLayout(page: NextPage) { +PlaygroundPage.getLayout = function getLayout(page: ReactNode) { return {page} }