Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update useSize.js #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tjcchen
Copy link

@tjcchen tjcchen commented Jul 17, 2023

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

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
@Yasin-97
Copy link

Yasin-97 commented Apr 5, 2024

It may cause issues because it directly references the internal development build of React. Instead, you can use the useEffect hook directly from React itself.

@tjcchen
Copy link
Author

tjcchen commented May 1, 2024

@Yasin-97 Yep, that's the reason why I pull this request. Hoping the author can merge my request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants