react-native-community/hooks

Can't get error from hooks (e.g. useCameraRoll and useGeolocation)

AleksandrChernyavenko opened this issue · 3 comments

In current implementation we just ignore errors. In some cases we need access to error.
I guess we need add error in hooks response to avoid breaking changes later.
What do you think about it ?

Example:

import { useGeolocation } from 'react-native-hooks'

const [position, stopObserving, setRNConfiguration, error] = useGeolocation()

console.log('latitude: ', position.coords.latitude)

console.log('error: ', error)

You have a point! If React version support hooks and we can add error state in this hook.
Same time you can follow this post facebook/react-native#21967 (comment)
then you can check all hooks and contribute hooks. But you can't use debug mode for hooks. @AleksandrChernyavenko

Since geolocation was extracted from react native core. The geolocation hooks should be moved to https://github.com/react-native-community/react-native-geolocation

We don't have useGeolocation anymore, so we can close this issue. Thanks!