Closed carl0804 closed 5 years ago
I got no footer and no response.
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", }
RN 0.60 and above is supported. Just remove the <View> wrapper and will work as expected.
<View>
It works, thanks a lot!
I got no footer and no response.