Fix useMeta util
This commit is contained in:
@@ -74,7 +74,7 @@ export function AnalyticsContext({
|
||||
// @ts-ignore
|
||||
if (metadata.__meta !== true) {
|
||||
throw new Error(
|
||||
'Use the meta() helper when passing metadata to AnalyticsContext',
|
||||
'Use the useMeta() helper when passing metadata to AnalyticsContext',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,7 @@ import {BSKY_SERVICE} from '#/lib/constants'
|
||||
import {type SessionAccount} from '#/state/session'
|
||||
import {type MergeableMetadata, type SessionMetadata} from '#/analytics/types'
|
||||
|
||||
export function meta(metadata: MergeableMetadata) {
|
||||
// I don't care
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
export function useMeta(metadata: MergeableMetadata) {
|
||||
const m = useMemo(() => metadata, [metadata])
|
||||
// @ts-ignore
|
||||
m.__meta = true
|
||||
|
||||
Reference in New Issue
Block a user