Skip to content

Commit

Permalink
chore(deps): tweak react-is version for pretty-format (#7046)
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa authored Dec 9, 2024
1 parent 751e2dc commit 4f718a2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions packages/pretty-format/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"tinyrainbow": "^1.2.0"
},
"devDependencies": {
"@types/react-is": "^18.3.0",
"react-is": "^18.3.1",
"react-is-19": "npm:react-is@19.0.0-rc-fb9a90fa48-20240614"
"@types/react-is": "^19.0.0",
"react-is": "^19.0.0",
"react-is-18": "npm:react-is@18.3.1"
}
}
6 changes: 3 additions & 3 deletions packages/pretty-format/src/plugins/ReactElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import type { Config, NewPlugin, Printer, Refs } from '../types'
import * as ReactIs18 from 'react-is'
import * as ReactIs19 from 'react-is'
// @ts-expect-error no type
import * as ReactIs19 from 'react-is-19'
import * as ReactIs18 from 'react-is-18'
import {
printChildren,
printElement,
Expand All @@ -35,7 +35,7 @@ const reactIsMethods = [
] as const

const ReactIs: typeof ReactIs18 = Object.fromEntries(
reactIsMethods.map(m => [m, (v: any) => (ReactIs18 as any)[m](v) || ReactIs19[m](v)]),
reactIsMethods.map(m => [m, (v: any) => ReactIs18[m](v) || (ReactIs19 as any)[m](v)]),
) as any

// Given element.props.children, or subtree during recursive traversal,
Expand Down
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f718a2

Please sign in to comment.