Hello. After migrating to v4 I got TypeError: (0 , _infernoMobx.connect) is not a function




How to resolve it?
Thx.
maybe you need to disable module transformation? Can you debug the code without sourcemaps to see what is (0 , _infernoMobx. object in this case.
Edit: connect has been removed as its been deprecated in react-mobx/inferno-mobx
I Believe this is correct syntax from v4 forward:
@inject('itemsStore') @observer
class ChildComponent extends React.Component {
render() {
return (
<div className="index">
{this.props.itemsStore.items.map((item, index) => {
return <span key={index}>item.name</span>
})}
</div>
);
}
}
See React documentation here:
https://mobx.js.org/intro/overview.html
same patterns apply to Inferno
Thanks. This helped me!
Most helpful comment
maybe you need to disable module transformation? Can you debug the code without sourcemaps to see what is
(0 , _infernoMobx.object in this case.Edit: connect has been removed as its been deprecated in
react-mobx/inferno-mobxI Believe this is correct syntax from v4 forward:
See React documentation here:
https://mobx.js.org/intro/overview.html
same patterns apply to Inferno