logicwind/react-native-fold-detection ? reverse-engineered prompt

Reverse engineered prompt

Build me a small React Native library that detects whether an Android device is foldable and tells me the current fold state.

I want a simple provider I can wrap around my app with, and a hook I can use on any screen to get the folding info, like the raw layout data plus helpful booleans for table top, book mode, and flat. Please include a basic example app that shows how to use it in a real screen.

Make sure it works cleanly on Android, and if iOS is not supported, disable it the right way so it does not cause issues there. I also want the package to feel polished, with clear setup instructions and a small, easy to understand public API. If you need to check current React Native or Android docs online while wiring up the fold detection behavior, go ahead and do that.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab