Skip to content

Commit cfa56bd

Browse files
authored
docs(analytics): example methods should be async (#4250)
According to `FirebaseAnalyticsTypes` `logSelectContent()` and `logEvent()` are async functions.
1 parent 0d82b05 commit cfa56bd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/analytics/usage/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ function App() {
5454
<View>
5555
<Button
5656
title="Add To Basket"
57-
onPress={() =>
58-
analytics().logEvent('basket', {
57+
onPress={async () =>
58+
await analytics().logEvent('basket', {
5959
id: 3745092,
6060
item: 'mens grey t-shirt',
6161
description: ['round neck', 'long sleeved'],
@@ -89,8 +89,8 @@ function App() {
8989
title="Press me"
9090
// Logs in the firebase analytics console as "select_content" event
9191
// only accepts the two object properties which accept strings.
92-
onPress={() =>
93-
analytics().logSelectContent({
92+
onPress={async () =>
93+
await analytics().logSelectContent({
9494
content_type: 'clothing',
9595
item_id: 'abcd',
9696
})

0 commit comments

Comments
 (0)