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

Can't use Hook useDimensions #331

Closed
swarnava-bhattacharya opened this issue Feb 12, 2023 · 3 comments
Closed

Can't use Hook useDimensions #331

swarnava-bhattacharya opened this issue Feb 12, 2023 · 3 comments

Comments

@swarnava-bhattacharya
Copy link

I see many people on YouTube tutorials using this specific hook but I can't import it, did y'all remove it by any chance? And if so how can I replicate the same thing with a different hook?

@LinusU
Copy link
Member

LinusU commented Feb 13, 2023

It this what you are looking for?

https://reactnative.dev/docs/usewindowdimensions

@SammyGutierrez335
Copy link

SammyGutierrez335 commented Mar 8, 2023

To answer the original question. Yes they did on pr 322.
#322

The tutorial I am working is using @react-native-community/hooks v2.5.1.
Run npm install @react-native-community/[email protected] if you want to run the tutorial as is but you are wise for just finding the updated hook for getting the same result.

@LinusU LinusU closed this as completed May 23, 2023
@anmol242
Copy link

anmol242 commented Jul 5, 2023

I am not sure why this was removed but useWindowDimesions is not stable. I have opened new issue for tracking what is the reason behind it: #390

See the thread related to Dimensions API in RN. Thread seems to close due to inactivity but Dimension API is not stable. I was using that in one of my application and when I open alert on same screen. Dimension listener sends delay response due to which UI disturbs in application.
Thread for issue: facebook/react-native#29451

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

No branches or pull requests

4 participants