react-native-torch-rcl
v2.0.1
Published
Torch/flashlight for react-native (modernized)
Downloads
192
Maintainers
Readme
📸 react-native-torch-rcl
Modernized Torch / Flashlight API for React Native (Android + iOS)
A fully updated, maintained, and CameraX-powered version of the abandoned react-native-torch library.
✨ Features
- ⚡ Modern Android support using CameraX
- 📱 iOS torch support via
AVCaptureDevice - 🔧 Clean Kotlin & Swift native modules
- 🔗 Compatible with React Native 0.72+ (including Fabric)
- 🔥 Simple API:
Torch.switchState(true | false) - 🧩 Drop-in replacement for the original
react-native-torch - 🛠 Actively maintained as
react-native-torch-rcl
📦 Installation
npm install react-native-torch-rcl
# or
yarn add react-native-torch-rcliOS Setup
cd ios && pod install
Usage
import Torch from 'react-native-torch-rcl';
const onOffFunc = async () => {
if (Platform.OS === 'ios') {
Torch.switchState(on);
} else {
const cameraAllowed = await Torch.requestCameraPermission();
if (cameraAllowed) {
Torch.switchState(on);
}
}
};
🔗 Repo link
Github link: Github →
📱 Our Apps
We also develop mobile apps — you can check them out on Google Play: Check it out →
