Skip to content

Commit

Permalink
Type fixes (@types/react is not installed)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkafton committed Feb 3, 2025
1 parent 7ea725c commit f5c56b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/utils/composeRefs.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { render, screen } from "@testing-library/react"

describe("composeRefs", () => {
test("Composing object + fn ref", () => {
const objRef1: React.RefObject<HTMLDivElement> = { current: null }
const objRef2: React.RefObject<HTMLDivElement> = { current: null }
const objRef1 = React.createRef<HTMLDivElement>()
const objRef2 = React.createRef<HTMLDivElement>()
const fnRef1 = jest.fn()
const fnRef2 = jest.fn()

Expand Down
2 changes: 1 addition & 1 deletion src/utils/useInterval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useRef, useEffect } from "react"
* Based on https://overreacted.io/making-setinterval-declarative-with-react-hooks/
*/
const useInterval = (callback: () => void, delay: number | null) => {
const savedCallback = useRef<() => void>()
const savedCallback = useRef<() => void>(() => {})

useEffect(() => {
savedCallback.current = callback
Expand Down

0 comments on commit f5c56b7

Please sign in to comment.