Hooked … in React Native

Angel Brown
1 min readMay 13, 2021

--

If you are familiar with React Hooks, Hooks in React Native are the same. They are used the same and include some of the following;

useKeyboard

useDimensions

useColorScheme

useDeviceOrientation

useCameraRoll

To be able to use it , it must be installed to be able to import them into your application.

npm install @react-native-community/hooks

Once imported you have a range of features that can be used to enhance your application. Honestly , from my teaching of React, React Native has cooler options for hooks which makes it easier to complete an application without a lot of coding. That is a big advantage for someone who is learning more about the language.

My favorite so far in my research would be useDeciveOrientation. It helps give you more versatility with directions of the user’s device. I know I hate it when I am on an app or website where the experience changes in a bad way when it turns from portrait to landscape. It takes the time away from me using the application and there is a high chance that I delete it. Being able to use “default” in app.json gives the application I’m working on the ability to move back and forth without a glitch in formatting.

--

--

No responses yet