Comments (10)
Hi @shroder!
Thanks for reporting this. I see in your example you are bringing in "mixin" twice. Both by composing and using the "mixins" property. Might that be it?
If not, this might just be something Cerebral should handle. Though if it fails with Cerebral, it probably fails with a lot of other existing projects. There is nothing special to this mixin really.
But okay, let me know about the composing and using mixin property and we go from there? :-)
from cerebral.
Hi @christianalfoni,
The mixins property you see is being ignored, at least I'm 99% sure. It's why I'm using the compose method. From what I recall, the mixins property doesn't actually get used. I think it's because React.createClass handles that normally. I'll try to double check this evening.
from cerebral.
@shroder , I think the problem is that mixins are not supported using the new ES6 class support (which is also the feature that makes pure functions work).
I wonder if you could wrap Cerebral into a react stamp and compose cerebral with your component. I haven't tried this yet. =)
from cerebral.
@shroder Or just try deleting line 7?
mixins: [mixin],
from cerebral.
The mixins property definitely isn't being used. Tested out my app without it and got the same error.
It looks like the mixin was moved to cerebral-react-immutable-store? My project is now behind version-wise, so I think I should update my packages to use the most recent versions of all my packages.
I have some other findings with 0.9.0, but I'll first see if it's still relevant after the upgrade.
from cerebral.
Great! Let us know how it went :-)
from cerebral.
@christianalfoni Have you tried using cerebral with react-stampit?
from cerebral.
Hi there!
did a small test now, and it works just fine it seems?
import {Mixin} from 'cerebral-react-immutable-store';
const MyComp = stampit(React, {
getStatePaths() {
return {key: ['path']}
},
render() {
return (
<div>Hello {this.state.key}</div>
);
}
}).compose(Mixin);
So make sure you import the Mixin correctly, it is a property on the Controller. As it uses the Mixin the state will be availalbe on the state object of the component, not props.
If it still does not work I think we have to work on a specific example :-) But yeah, I tried it and it worked on my end
from cerebral.
👍
from cerebral.
Closing this as it seems to have worked out :-)
from cerebral.
Related Issues (20)
- Allow providers to have keys other than functions HOT 1
- What happened to mobx-state-tree HOT 4
- Change in computed state does not trigger reactions HOT 2
- A certain combination of feature usage causes forceUpdate() on an unmounted component HOT 1
- How to use cerebral in vue-router hooks? HOT 2
- reaction errors HOT 7
- module.signals is DEPRECATED but controller in @cerebral/mobx-state-tree can't provide sequences HOT 1
- Can't resolve nested value via moduleState HOT 2
- Docs test page spelling error HOT 2
- When using devtools, cannot change store state using string path. HOT 1
- codesandbox.io using wrong cerebral version. HOT 1
- Setting non-existent path in state works without devtools, throws error with devtools HOT 1
- Cerebral v4: Deprecated React lifecycle methods HOT 1
- function-tree Can't resolve './StopExecution' HOT 3
- Can't resolve nested value via moduleState (from computed) HOT 1
- Cerebral 5.2.0: inferno does render child before parent HOT 2
- access dotted keys HOT 1
- parallel does not work as expected HOT 1
- `addModule` doesn't initialize reactions
- React 19 compatibility
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cerebral.