What are hooks in React Native?

Why Interviewers Ask This

This is a classic screening question for React Native roles. Hiring managers ask it early in interviews to gauge your baseline understanding and determine if you can communicate technical concepts clearly.

Answer

React Native uses the same React hooks as React web — they work identically. All standard hooks apply: useState: local component state: const [count, setCount] = useState(0);. useEffect: side effects — data fetching, subscriptions, cleanup. Runs after render: useEffect(() => { fetchData(); return () => { cleanup(); }; }, [dependency]);. useCallback: memoize a function — prevents unnecessary re-renders of child components that receive the function as a prop: const handlePress = useCallback(() => { doSomething(); }, [dependency]);. useMemo: memoize computed value: const expensiveValue = useMemo(() => computeExpensive(data), [data]);. useRef: access a component or store a mutable value without re-render: const inputRef = useRef(null); inputRef.current.focus();. useContext: access context value: const theme = useContext(ThemeContext);. useReducer: complex state logic: const [state, dispatch] = useReducer(reducer, initialState);. React Native-specific hooks (from libraries): useFocusEffect (React Navigation) — runs when screen is focused; useNavigation (React Navigation) — access navigation object anywhere; useSafeAreaInsets (react-native-safe-area-context) — get safe area insets for notch/home indicator; useColorScheme (built-in) — detect dark/light mode: const colorScheme = useColorScheme(); // "dark" | "light" | null. Custom hooks: same pattern as React web — extract reusable stateful logic into functions starting with "use".

Common Mistake

Rushing to answer is a common mistake. Take two seconds to structure your response: definition → example → trade-off. This structure makes complex React Native answers easy to follow.