mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 01:50:06 +02:00
Update dependencies to React 18, Node 20, TS 5.2, etc. (#5528)
* incremental upgrade to React 18, TS 4.9, etc. * update yarn config * fix build * minor cleanup in type definitions * incremental updates for TS 5.0 * fix build * upgrade to typescript 5.2 * update dependencies * fix lint issues * update to latest Playwright version * update changesets dep * update emotion/css * incremental dependency updates * more small dependency updates * upgrade prettier and eslint * fix lint issues * update dependencies rollup * fix @types/node resolution to restore linting * update tiny-invariant dependency * update dependencies * update dependencies lerna * upgrade react-router-dom * update @types/react and @types/node * update babel dependencies * udpate simple-git-hooks * update @types/node resolution * update lint-staged * remove cypress from dependency list * update @types/node to support Node 20 * update workflows to Node 20 * set resolutions for @types/react * downgrade @types/react to 18.2.28 * update mocha * update rimraf * update @types/js-dom * remove .lintstagedrc.js * upgrade next to latest * v0.61.4 * update lerna * update faker and rollup * update immer * fix yarn clean command * attempt to fix integration tests * attempt to stabilize integration tests * wip fix integration tests * skip unstable integration test * Add changeset --------- Co-authored-by: Dalibor Tosic <dalibortosic00@gmail.com> Co-authored-by: Nikola <nikolabijelic14@gmail.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import React, { useState, PropsWithChildren, Ref } from 'react'
|
||||
import React, { useState, PropsWithChildren, Ref, ErrorInfo } from 'react'
|
||||
import { cx, css } from '@emotion/css'
|
||||
import Head from 'next/head'
|
||||
import Link from 'next/link'
|
||||
import dynamic from 'next/dynamic'
|
||||
import ErrorBoundary from 'react-error-boundary'
|
||||
import { ErrorBoundary } from 'react-error-boundary'
|
||||
|
||||
import { Icon } from '../../components'
|
||||
|
||||
@@ -258,7 +258,7 @@ const Warning = props => (
|
||||
|
||||
const ExamplePage = ({ example }: { example: string }) => {
|
||||
const [error, setError] = useState<Error | undefined>()
|
||||
const [stacktrace, setStacktrace] = useState<string | undefined>()
|
||||
const [stacktrace, setStacktrace] = useState<ErrorInfo | undefined>()
|
||||
const [showTabs, setShowTabs] = useState<boolean>()
|
||||
const EXAMPLE = EXAMPLES.find(e => e[2] === example)
|
||||
const [name, Component, path] = EXAMPLE
|
||||
@@ -268,6 +268,19 @@ const ExamplePage = ({ example }: { example: string }) => {
|
||||
setError(error)
|
||||
setStacktrace(stacktrace)
|
||||
}}
|
||||
fallbackRender={({ error, resetErrorBoundary }) => (
|
||||
<Warning>
|
||||
<p>An error was thrown by one of the example's React components!</p>
|
||||
<pre>
|
||||
<code>
|
||||
{error.stack}
|
||||
{'\n'}
|
||||
{stacktrace}
|
||||
</code>
|
||||
</pre>
|
||||
<button onClick={resetErrorBoundary}>Try again</button>
|
||||
</Warning>
|
||||
)}
|
||||
>
|
||||
<div>
|
||||
<Head>
|
||||
@@ -315,6 +328,7 @@ const ExamplePage = ({ example }: { example: string }) => {
|
||||
key={p as string}
|
||||
href="/examples/[example]"
|
||||
as={`/examples/${p}`}
|
||||
legacyBehavior
|
||||
passHref
|
||||
>
|
||||
<Tab onClick={() => setShowTabs(false)}>{n}</Tab>
|
||||
@@ -326,9 +340,11 @@ const ExamplePage = ({ example }: { example: string }) => {
|
||||
<p>An error was thrown by one of the example's React components!</p>
|
||||
<pre>
|
||||
<code>
|
||||
{error.stack}
|
||||
{'\n'}
|
||||
{stacktrace}
|
||||
<>
|
||||
{error.stack}
|
||||
{'\n'}
|
||||
{stacktrace}
|
||||
</>
|
||||
</code>
|
||||
</pre>
|
||||
</Warning>
|
||||
|
Reference in New Issue
Block a user