Skip to content

Commit 01aa0de

Browse files
authored
Update useSize.js
Hello Kelly, thanks much for such great sharing. I notice this line of import in custom `useSize` hook. `import { useEffect } from "react/cjs/react.development"` Is this import intended or just a typo or something. I found in newer react versions, this line of code cast errors in my place. Could we just use the `useEffect` hook from `react` directly. Thanks
1 parent fd1c0d7 commit 01aa0de

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: src/19-useSize/useSize.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { useState } from "react"
2-
import { useEffect } from "react/cjs/react.development"
1+
import { useState, useEffect } from "react"
32

43
export default function useSize(ref) {
54
const [size, setSize] = useState({})

0 commit comments

Comments
 (0)