MCPcopy Create free account
hub / github.com/a7medev/react-native-ml-kit / ChooseImageButton

Function ChooseImageButton

example/src/core/ChooseImageButton.tsx:15–33  ·  view source on GitHub ↗
({onChoose}: ChooseImageButtonProps)

Source from the content-addressed store, hash-verified

13}
14
15const ChooseImageButton = ({onChoose}: ChooseImageButtonProps) => {
16 const handlePress = async () => {
17 const imageResult = await ImagePicker.launchImageLibraryAsync();
18 if (imageResult.canceled) {
19 return;
20 }
21
22 const asset = imageResult.assets![0];
23 const currentImage = {
24 path: asset.uri,
25 width: asset.width,
26 height: asset.height,
27 };
28
29 onChoose(currentImage);
30 };
31
32 return <Button title="Choose an Image" onPress={handlePress} />;
33};
34
35export default ChooseImageButton;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected