React Native hook for Camera Roll
yarn add @rnhooks/camera-roll
import useCameraRoll from '@rnhooks/camera-roll';
function App() {
const [photos, getPhotos, saveToCameraRoll, error] = useCameraRoll();
return (
<View style={styles.container}>
<Text style={styles.welcome}>@rnhooks/camera-roll</Text>
<Button title="Get Photos" onPress={getPhotos} />
</View>
);
}
Name | Default | Type | Description |
---|---|---|---|
photos | Defaults | object | Photos Object |
getPhotos | (params) => {} |
function | Get Photos Function |
saveToCameraRoll | () => {} |
function | Save to Camera Roll Function |
error | undefined |
string | Error string |
const initialState = {
edges: [],
page_info: {
has_next_page: false,
start_cursor: '',
end_cursor: '',
},
};