New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-native-compass-k

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-compass-k

React Native implementation of image editor with compass, crop, brightness, and rotation features

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

react-native-compass-k

React Native implementation of image editor with compass overlay, crop, brightness adjustment, and rotation features.

Installation

npm install react-native-compass-k

Additional Setup

This package requires some native dependencies. After installation, you may need to run:

# Install peer dependencies (if not already installed)
npm install react react-native

# Install required dependencies
npm install expo-image-manipulator react-native-image-picker react-native-svg

# For iOS
cd ios && pod install && cd ..

# For Android, no additional steps needed

Important: Make sure react and react-native are installed in your main project's node_modules, not in the package's node_modules. If you encounter "Cannot read property 'useState' of null" errors, try:

# Remove node_modules and reinstall
rm -rf node_modules
npm install

# Or use npm's dedupe to fix duplicate React instances
npm dedupe

Note: If you're not using Expo, you may need to use react-native-image-manipulator instead of expo-image-manipulator. Please check the compatibility with your React Native setup.

Usage

import { ImageController } from 'react-native-compass-k';

function App() {
  return (
    <ImageController
      onImageSelected={(result) => {
        console.log('Image:', result.image);
        console.log('Compass:', result.compass);
        console.log('Edits:', result.edits);
      }}
      enableCompass={true}
      enableCrop={true}
      enableBrightness={true}
      enableZoom={true}
      enableRotation={true}
      language="en"
    />
  );
}

Features

  • Compass Overlay: Add and position a compass on images with rotation support
  • Crop: Select and adjust crop areas with drag handles
  • Brightness: Adjust image brightness with slider
  • Zoom: Zoom in/out on images
  • Rotation: Rotate images in 90-degree increments
  • Multi-language: Support for English, Marathi, and Hindi

Props

ImageController

PropTypeDefaultDescription
onImageSelected(result) => voidrequiredCallback when image is saved
onCancel() => voidoptionalCallback when editing is cancelled
enableCompassbooleantrueEnable compass overlay
enableCropbooleantrueEnable crop functionality
enableBrightnessbooleantrueEnable brightness adjustment
enableZoombooleantrueEnable zoom functionality
enableRotationbooleantrueEnable rotation functionality
maxFileSizenumber10MBMaximum file size in bytes
acceptedFileTypesstring[]['image/*']Accepted file types
languagestring'en'Language code ('en', 'mr', 'hi')

Troubleshooting

"Cannot read property 'useState' of null" Error

This error occurs when React is not properly resolved. Try:

  • Clear and reinstall dependencies:

    rm -rf node_modules package-lock.json
    npm install
    
  • Deduplicate React instances:

    npm dedupe
    
  • Ensure React is in your main project: Make sure react and react-native are installed in your project's root node_modules, not in node_modules/react-native-compass-k/node_modules.

License

MIT

Keywords

react-native

FAQs

Package last updated on 20 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts