How to use the react-firebase-hooks/firestore.useDocumentOnce function in react-firebase-hooks

To help you get started, we’ve selected a few react-firebase-hooks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yarnaimo / vanilla-clipper / web / src / App / Note / index.ts View on Github external
const _Note: FC = ({ id }) => {
    const [ss, loading, error] = useDocumentOnce(notes.doc(id))
    const note = useMemo(() => ss && Note.ss(ss), [ss])

    if (loading || error) {
        return $(LoadingOrError, { loading, error })()
    }

    return $(Editor, {
        data: note ? (note.data as any) : undefined,
    })()
}

react-firebase-hooks

React Hooks for Firebase

Apache-2.0
Latest version published 1 year ago

Package Health Score

62 / 100
Full package analysis