Skip to content

Commit 13f0647

Browse files
committed
upgrade to react 19
1 parent a72b67b commit 13f0647

File tree

16 files changed

+103
-121
lines changed

16 files changed

+103
-121
lines changed

epicshop/package-lock.json

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
/** @type {import('@types/eslint').Linter.Config} */
22
export default {
3+
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
34
languageOptions: { parser: await import('@typescript-eslint/parser') },
45
plugins: {
56
'@typescript-eslint': (await import('@typescript-eslint/eslint-plugin'))
67
.default,
8+
'react-hooks': (await import('eslint-plugin-react-hooks')).default,
79
import: (await import('eslint-plugin-import')).default,
810
},
911
rules: {
10-
// playwright requires destructuring in fixtures even if you don't use anything 🤷‍♂️
11-
'no-empty-pattern': 'off',
12+
'react-hooks/rules-of-hooks': 'error',
13+
'react-hooks/exhaustive-deps': 'warn',
14+
1215
'@typescript-eslint/consistent-type-imports': [
1316
'warn',
1417
{

exercises/05.portals/01.problem.create/posts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { useState } from 'react'
2+
import { getQueryParam, useSearchParams } from './params'
3+
import { ButtonWithTooltip } from './tooltip'
24
import {
35
type BlogPost,
46
generateGradient,
57
getMatchingPosts,
68
} from '#shared/blog-posts'
7-
import { getQueryParam, useSearchParams } from './params'
8-
import { ButtonWithTooltip } from './tooltip'
99

1010
export function MatchingPosts() {
1111
const [searchParams] = useSearchParams()

exercises/05.portals/01.problem.create/tooltip.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function Tooltip({
1414
children: React.ReactNode
1515
targetRect: Position | null
1616
}) {
17-
const ref = useRef<HTMLDivElement | null>(null)
17+
const ref = useRef<HTMLDivElement>(null)
1818
const [tooltipHeight, setTooltipHeight] = useState(0)
1919

2020
useEffect(() => {
@@ -54,7 +54,7 @@ function TooltipContainer({
5454
children: React.ReactNode
5555
x: number
5656
y: number
57-
contentRef: React.RefObject<HTMLDivElement>
57+
contentRef: React.RefObject<HTMLDivElement | null>
5858
}) {
5959
return (
6060
<div

exercises/05.portals/01.solution.create/posts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { useState } from 'react'
2+
import { getQueryParam, useSearchParams } from './params'
3+
import { ButtonWithTooltip } from './tooltip'
24
import {
35
type BlogPost,
46
generateGradient,
57
getMatchingPosts,
68
} from '#shared/blog-posts'
7-
import { getQueryParam, useSearchParams } from './params'
8-
import { ButtonWithTooltip } from './tooltip'
99

1010
export function MatchingPosts() {
1111
const [searchParams] = useSearchParams()

exercises/05.portals/01.solution.create/tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function TooltipContainer({
5555
children: React.ReactNode
5656
x: number
5757
y: number
58-
contentRef: React.RefObject<HTMLDivElement>
58+
contentRef: React.RefObject<HTMLDivElement | null>
5959
}) {
6060
return (
6161
<div

exercises/06.layout-computation/01.problem.layout-effect/posts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { useState } from 'react'
2+
import { getQueryParam, useSearchParams } from './params'
3+
import { ButtonWithTooltip } from './tooltip'
24
import {
35
type BlogPost,
46
generateGradient,
57
getMatchingPosts,
68
} from '#shared/blog-posts'
7-
import { getQueryParam, useSearchParams } from './params'
8-
import { ButtonWithTooltip } from './tooltip'
99

1010
export function MatchingPosts() {
1111
const [searchParams] = useSearchParams()

exercises/06.layout-computation/01.problem.layout-effect/tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function TooltipContainer({
6363
children: React.ReactNode
6464
x: number
6565
y: number
66-
contentRef: React.RefObject<HTMLDivElement>
66+
contentRef: React.RefObject<HTMLDivElement | null>
6767
}) {
6868
return (
6969
<div

exercises/06.layout-computation/01.solution.layout-effect/posts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { useState } from 'react'
2+
import { getQueryParam, useSearchParams } from './params'
3+
import { ButtonWithTooltip } from './tooltip'
24
import {
35
type BlogPost,
46
generateGradient,
57
getMatchingPosts,
68
} from '#shared/blog-posts'
7-
import { getQueryParam, useSearchParams } from './params'
8-
import { ButtonWithTooltip } from './tooltip'
99

1010
export function MatchingPosts() {
1111
const [searchParams] = useSearchParams()

exercises/06.layout-computation/01.solution.layout-effect/tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function TooltipContainer({
6161
children: React.ReactNode
6262
x: number
6363
y: number
64-
contentRef: React.RefObject<HTMLDivElement>
64+
contentRef: React.RefObject<HTMLDivElement | null>
6565
}) {
6666
return (
6767
<div

0 commit comments

Comments
 (0)