-
-
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
@observable doesn't cause a re-render when using Typescript #1071
Comments
I've transformed part of core module to javascript ES6 transpiled with babel-cli and it works! |
Are you sure your code is correct? Look like you are trying to set |
I'ts a mistake, it is really set to |
Does downgrading to mobx 3.1.9 make a difference? (Before the rollup packaging). Can you double check you are nowhere importing from something like Could you produce (a simplfiied) project setup? |
Downgrading mobx didn't help. setup:
|
@mweststrate I had some errors running the attached project setup. Just fixed it so if you have downloaded it already, please download again. |
@naomipol I can't run project. But I think the problem is you are using several mobx installs (one in core and one in web). |
@farwayer I've removed the separate mobx install from web - still the same issue |
I can't run the project:
|
Note that both projects still require mobx as dependency. Please make 'mobx' a peer dependency in |
That was it!!! But, when I link the 'core' module to the 'web' project with Do you know of any way to overcome this problem? |
Was able to solve the |
Having the same issue. Does not seem like resolutions of using |
Hi @fosteman Please don't write in closed issues. Create a new issue instead. Make sure codesandbox reproduction is included: https://codesandbox.io/s/minimal-mobx-react-project-ppgml?file=/index.js |
Hi, I have an issue
I just started developing a new project where i use mobx for a shared state management core module between a react web app and react-native mobile app.
The core module uses typescript, it is compiled and consumed by both app projects.
My problem is non of the components in both projects re-render when an
@observable
property in a store (from the core module) changes.When I create a the store with the same definition and logic in each of the projects, the components re-render as expected.
I believe this issue has something with importing stores compiled from Typescript into a non typescript project, but i can't get over it!
Additional info:
.ts
store file:.tsconfig
file:mobx
andmobx-react
versions.Provider
configured..):I would be very thankful for any help!
The text was updated successfully, but these errors were encountered: