-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Issue with @computed after update to 4.0.0 on React Native #1396
Comments
That is a lot of code. Could you minimize it? |
Actually, yes.
` This error is located at:
` |
Can you create a sandbox or repo from that?
Op wo 14 mrt. 2018 17:56 schreef Eugene Alitz <[email protected]>:
… Actually, yes.
I tried very simple component, and this error still happen:
`
import React, { Component } from 'react';
import { ScrollView, Image, Text, Picker, StyleSheet, ImageBackground }
from 'react-native';
import { observer, inject } from 'mobx-react'
import { computed, when } from 'mobx'
class LoginScreen extends Component {
@computed get test () {
return 'test'
}
render () {
return (
<Text>
{this.test}
</Text>
);
}
}
export default observer ( LoginScreen );
`
handleException @ D:\Sites\work\eton4y…ptionsManager.js:65
showErrorDialog @ D:\Sites\work\eton4y…nderer-dev.js:11170
logCapturedError @ D:\Sites\work\eton4y…nderer-dev.js:11180
captureError @ D:\Sites\work\eton4y…nderer-dev.js:12116
renderRoot @ D:\Sites\work\eton4y…nderer-dev.js:11950
performWorkOnRoot @ D:\Sites\work\eton4y…nderer-dev.js:12742
performWork @ D:\Sites\work\eton4y…nderer-dev.js:12660
performSyncWork @ D:\Sites\work\eton4y…nderer-dev.js:12622
requestWork @ D:\Sites\work\eton4y…nderer-dev.js:12535
scheduleWorkImpl @ D:\Sites\work\eton4y…nderer-dev.js:12374
scheduleWork @ D:\Sites\work\eton4y…nderer-dev.js:12321
scheduleRootUpdate @ D:\Sites\work\eton4y…nderer-dev.js:13025
updateContainerAtExpirationTime @
D:\Sites\work\eton4y…nderer-dev.js:13059
updateContainer @ D:\Sites\work\eton4y…nderer-dev.js:13077
render @ D:\Sites\work\eton4y…nderer-dev.js:13796
renderApplication @ D:\Sites\work\eton4y…erApplication.js:58
run @ D:\Sites\work\eton4y…\AppRegistry.js:103
runApplication @ D:\Sites\work\eton4y…\AppRegistry.js:196
__callFunction @ D:\Sites\work\eton4y…MessageQueue.js:353
(anonymous) @ D:\Sites\work\eton4y…MessageQueue.js:118
__guardSafe @ D:\Sites\work\eton4y…MessageQueue.js:316
callFunctionReturnFlushedQueue @
D:\Sites\work\eton4y…MessageQueue.js:117
(anonymous) @ debuggerWorker.js:72
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1396 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhD0W4XUrihA_7hJSMBaC1IAOSJUiks5teUuigaJpZM4SodHm>
.
|
Yes, here i created a simplest ReactNative App ever, take a look at the App component. |
And this issue is happen only in React Native. In regular React app everything work just fine |
We're seeing the same problem in our React Native project. |
Does 4.0.2 change anything?
Op wo 14 mrt. 2018 22:13 schreef Sean Timm <[email protected]>:
… We're seeing the same problem in our React Native project.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1396 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhJ9-RO44OgodfQ5hoQnoi4qgB9fqks5teYfogaJpZM4SodHm>
.
|
Nope... same error. |
Same here. Fails only with |
Could it relate to hot reloading? (Dunno if that can be disabled?). Does @computed({}) get .... work better? |
I have hot-reloading disabled. Same fail with |
Just released a beta patch, can one verify whether this solves the issue? |
Yes, it works!! |
Released as 4.1! |
This change breaks compatible with mobx 4.0.0 & 3.x import { computed, observable } from "mobx";
class A {
@observable _id;
constructor() {
this._id = "A";
}
@computed get id() {
return "A_id: " + this._id;
}
}
class B extends A {
constructor() {
super();
this._id = "B";
}
get id() {
return "B_id: " +this._id;
}
}
let a = new A();
let b = new B();
console.log(a.id); // A_id: A
console.log(b.id); // A_id: B in 3.6.2 & 4.0.0
in 4.1.0
|
Please open new issues for new issues
Op di 20 mrt. 2018 18:41 schreef rzcoder <[email protected]>:
… This change breaks compatible with mobx 4.0 & 3.0
import { computed, observable } from "mobx";
class A {
@observable _id;
constructor() {
this._id = "A";
}
@computed get id() {
return "A_id: " + this._id;
}
}
class B extends A {
constructor() {
super();
this._id = "B";
}
get id() {
return "B_id: " +this._id;
}
}
let a = new A();let b = new B();
console.log(a.id); // A_id: Aconsole.log(b.id); // A_id: B
in 3.6.2 & 4.0.0
A_id: A
B_id: B
in 4.1.0
A_id: A
A_id: B
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1396 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhDBY5bmmMkhkt3wqw7mISyIN2tYvks5tgT89gaJpZM4SodHm>
.
|
ok, #1443 |
I am experiencing this same issue again in MobX 5.0.3. |
I am experiencing this issue as well. |
Please open new issues for new issues |
Hello, and thank you for this awesome library.
I`m working on RN project, and after update to the 4.0.0 version, stuck with some strange issue. (when downgrading to 3.6.2 everything work fine).
So i have a rootStore:
`import GuiStore from './GuiStore';
import UserStore from './UserStore';
import SchoolsStore from './SchoolsStore';
class RootStore {
constructor () {
this.guiStore = new GuiStore ( this );
this.schoolsStore = new SchoolsStore ( this );
this.userStore = new UserStore ( this );
}
}
const appStore = new RootStore ();
export { appStore };`
and relevant inner Stores:
SCHOOL STORE
`import { action, computed, observable, toJS } from 'mobx';
import { find, map } from 'lodash'
import firebase from 'react-native-firebase';
const db = firebase.firestore ();
class SchoolsStore {
}
export default SchoolsStore;
`
USER STORE
`import { action, computed, observable, toJS } from 'mobx';
import firebase from 'react-native-firebase';
const db = firebase.firestore ();
const FCM = firebase.messaging ();
class UserStore {
}
export default UserStore;
`
The issue is happens here - at Login Screen:
on launch i receive an error
I found out, that if i comment the
@computed get fetchInProgress
and a when block, and{ !this.fetchInProgress && this.userStore.user && !this.userStore.user.activeSchool && <FormWrapper navigationHandler={this.navigateTo}/> }
no error happen, so i think that issue come from using @computed properties.
Why is this happen?
The text was updated successfully, but these errors were encountered: