For some reason create react app isn't "seeing through" the use-fireproof dependency to grab @fireproof/core properly.
Instead you have to initialize and pass in your own database and index objects. This incantation will work anywhere, but is a required workaround for CRA:
import { useFireproof } from 'use-fireproof'
import { fireproof, index } from '@fireproof/core'
function App() {
const { database, useLiveQuery } = useFireproof(fireproof('legendary'))
const sorted = useLiveQuery(index(database, 'sort'))
In normal application, you can omit the fireproof() and index() wrapper and useFireproof and useLiveQuery will just do the correct thing. See #1 about fixing the build bundle.
For some reason create react app isn't "seeing through" the
use-fireproof
dependency to grab@fireproof/core
properly.Instead you have to initialize and pass in your own database and index objects. This incantation will work anywhere, but is a required workaround for CRA:
In normal application, you can omit the
fireproof(
) andindex()
wrapper anduseFireproof
anduseLiveQuery
will just do the correct thing. See #1 about fixing the build bundle.