inProgress-team / inProgress-team/react-native-meteor

Problem with React Navigation

Open
#258 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
688
Forks
200
PR merge metrics
No merged PRs in 30d

Description

I am using tabNavigation. When I subscribe data to my first component, it works just fine. But when I did subscriptions on second Component, the app crash, and the subscriptions looping forever.

Strangely when I did subscriptions that needed on second component inside first component, the app run just fine.

------------------------
example:

**THIS WILL CRASH, subscriptions looping forever!!!**

screen/Contacts.js
```javascript
class Contacts extends Component {

}

createContainer((props)=>{
Meteor.subscribe('contacts', {});

return {
chats: Meteor.collection('contact').find()
}
}, Contacts);
```

screen/Chats.js
```javascript
class Chats extends Component {

}

createContainer((props)=>{
Meteor.subscribe('chats', {});

return {
chats: Meteor.collection('chats').find()
}
}, Chats);
```

**WHILE THIS ISN'T CRASH???**

screen/Contacts.js
```javascript
class Contacts extends Component {

}

createContainer((props)=>{
//DID ALL SUBSCRIPTIONS HERE!!
Meteor.subscribe('contacts', {});
Meteor.subscribe('chats', {});

return {
chats: Meteor.collection('contact').find()
}
}, Contacts);
```

screen/Chats.js
```javascript
class Chats extends Component {

}

createContainer((props)=>{
return {
chats: Meteor.collection('chats').find()
}
}, Chats);
```

and the router is just as simple as this:
```javascript
const RootNavigation = TabNavigator({
Contact: {screen: Contact},
Chat: {screen: Chat},
})
```

if you want to look at my code, please take a look at my github code:
https://github.com/radiegtya/BukanMessenger

Thanks.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.