Skip to main content
React Native provides a comprehensive set of core APIs that enable you to build powerful mobile applications. These APIs provide access to native platform features and utilities that work across both iOS and Android.

Available APIs

UI and Interaction

Alert

Display native alert dialogs and prompts

Keyboard

Control and respond to keyboard events

Animation

Animated

Powerful animation library for creating smooth animations

App Lifecycle

AppState

Monitor app foreground/background state

Device Information

Dimensions

Get device screen dimensions

Platform

Platform-specific code and information

Linking

Handle deep links and external URLs

Styling

StyleSheet

Create and manage component styles

Usage Patterns

Most React Native APIs follow consistent patterns:

Importing APIs

import { Alert, Platform, StyleSheet } from 'react-native';

Event Listeners

Many APIs provide event listeners that return a subscription object:
const subscription = AppState.addEventListener('change', (state) => {
  console.log('App state changed to:', state);
});

// Clean up
subscription.remove();

Platform-Specific Code

Use the Platform API to write platform-specific code:
const styles = StyleSheet.create({
  container: {
    ...Platform.select({
      ios: { paddingTop: 20 },
      android: { paddingTop: 0 },
    }),
  },
});

Best Practices

Prefer using useEffect to set up and clean up event listeners:
useEffect(() => {
  const subscription = AppState.addEventListener('change', handleAppStateChange);
  return () => subscription.remove();
}, []);
Use useNativeDriver: true in Animated APIs for better performance:
Animated.timing(animatedValue, {
  toValue: 1,
  duration: 300,
  useNativeDriver: true,
}).start();
Listen for dimension changes to support device rotation:
useEffect(() => {
  const subscription = Dimensions.addEventListener('change', ({ window }) => {
    console.log('New dimensions:', window);
  });
  return () => subscription?.remove();
}, []);

Next Steps

Explore individual API documentation to learn about specific features, methods, and examples.

Build docs developers (and LLMs) love