Skip to content

Commit 8ef184f

Browse files
committed
Fix error in the example code
1 parent 2657c42 commit 8ef184f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-mongo/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ import React from 'react'
4848
import { useSubscription } from 'meteor/react-mongo'
4949

5050
const MyComponent = ({ id = null }) => {
51-
const subscription = useSubscription(() => (
52-
if (id) Meteor.subscribe(id)
53-
), {
51+
const subscription = useSubscription(() => {
52+
if (id) return Meteor.subscribe(id)
53+
}, {
5454
deps: [id],
5555
updateOnReady: false
5656
})

0 commit comments

Comments
 (0)