hooks
hooks copied to clipboard
Refactor useDeviceOrientation hook
Summary
Simplifies the code, and also fixes an issue where the initial value could be stale as described in #210
Test Plan
Will test this in a snack, will update with link shortly
What's required for testing (prerequisites)?
nothing special
What are the steps to reproduce (after prerequisites)?
change the orientation and observe the updated value
Compatibility
| OS | Implemented |
|---|---|
| iOS | ✅ |
| Android | ✅ |
| Web | ✅ |
Checklist
- [ ] I have tested this on a device and a simulator
- [n/a] I added the documentation in
README.md - [n/a] I updated the typed files (TS and Flow)
- [ ] I've created a snack to demonstrate the changes: LINK HERE