We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This code causes infinite loop, anything wrong?
`import React, {useState} from 'react'; import { Dimensions, View, Image, Button } from 'react-native'; import ImageCropper from 'react-native-simple-image-cropper'; const window = Dimensions.get('window'); const w = window.width;
const IMAGE = 'https://picsum.photos/id/48/900/500';
const CROP_AREA_WIDTH = w; const CROP_AREA_HEIGHT = w;
export const ModalSelectSnap: React.FC<{}> = () => { const [cropperParams, setCropperParams] = useState({});
let setCropperParamsFunction = (params) => { console.log("setCropperParams.........."); console.log(cropperParams); setCropperParams({params}); };
return ( <View style={{flex: 1}}> <ImageCropper imageUri={IMAGE} cropAreaWidth={CROP_AREA_WIDTH} cropAreaHeight={CROP_AREA_HEIGHT} containerColor="black" areaColor="black" setCropperParams={setCropperParamsFunction} /> </View> )
}`
The text was updated successfully, but these errors were encountered:
Hi, @dressas! Sorry for late answer. Example app was updated. Now it is using react-hooks. Maybe it will help to you. https://github.com/barrsan/react-native-simple-image-cropper/blob/master/example/App.js#L60
Sorry, something went wrong.
Works fine when I place it in App.tsx but getting infinite loop when use it somewhere else in the app, like in other screens or in component.
No branches or pull requests
This code causes infinite loop, anything wrong?
`import React, {useState} from 'react';
import { Dimensions, View, Image, Button } from 'react-native';
import ImageCropper from 'react-native-simple-image-cropper';
const window = Dimensions.get('window');
const w = window.width;
const IMAGE = 'https://picsum.photos/id/48/900/500';
const CROP_AREA_WIDTH = w;
const CROP_AREA_HEIGHT = w;
export const ModalSelectSnap: React.FC<{}> = () => {
const [cropperParams, setCropperParams] = useState({});
let setCropperParamsFunction = (params) => {
console.log("setCropperParams..........");
console.log(cropperParams);
setCropperParams({params});
};
}`
The text was updated successfully, but these errors were encountered: