ggunti / react-native-amazing-cropper

Image cropper for react native using Animated API
MIT License
145 stars 83 forks source link

Support RN version above 0.60 ? I got no response #19

Closed carl0804 closed 5 years ago

carl0804 commented 5 years ago

I got no footer and no response.

Screenshot_1574647060

import React, { Component } from 'react';
import { View, Text } from 'react-native';

import AmazingCropper, { DefaultFooter } from 'react-native-amazing-cropper';

class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
    };
  }

  onDone = (croppedImageUri) => {
    console.log('croppedImageUri = ', croppedImageUri);
    // send image to server for example
  }

  onCancel = () => {
    console.log('Cancel button was pressed');
    // navigate back
  }

  render() {
    return (
      <View>
         <AmazingCropper
            // Pass custom text to the default footer
            footerComponent={<DefaultFooter doneText='OK' rotateText='ROT' cancelText='BACK' />}
            onDone={this.onDone}
            onCancel={this.onCancel}
            imageUri='http://192.168.0.107/images/16.jpg'
            imageWidth={426}
            imageHeight={640}
        />
      </View>
    );
  }
}

export default App;
  "dependencies": {
    "@react-native-community/image-editor": "^2.2.0",
    "react": "16.9.0",
    "react-native": "0.61.4",
    "react-native-amazing-cropper": "^0.1.0",
    "react-native-image-rotate": "^2.1.0",
  }
ggunti commented 5 years ago

RN 0.60 and above is supported. Just remove the <View> wrapper and will work as expected. removeview

carl0804 commented 4 years ago

RN 0.60 and above is supported. Just remove the <View> wrapper and will work as expected. removeview

It works, thanks a lot!