Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription does not work in a loop #80

Open
phibya opened this issue Jan 17, 2017 · 0 comments
Open

Subscription does not work in a loop #80

phibya opened this issue Jan 17, 2017 · 0 comments

Comments

@phibya
Copy link

phibya commented Jan 17, 2017

In React, I have a page Account that has a MysqlSubscription named accounts
If I create a component Page with another MysqlSubscription name pages and send accountId parameter to it, then use a loop in page Account to render that page, the subscription in Page will not work. (the subscription in Account still works).

render(){
    return (
        this.data.accounts.map(({accountId})=>{
              <Page accountId={accountId} />
        })
    )
}

If I remove the loop like this:

render(){
    return (
        <Page accountId={1} />
    )
}

or use a static array:

render(){
    return (
        [{accountId: 1},{accountId: 2}].map(({accountId})=>{
              <Page accountId={accountId} />
        })
    )
}

the subscription will work again.

@phibya phibya changed the title Subscription does work in a loop Subscription does not work in a loop Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant