-
Notifications
You must be signed in to change notification settings - Fork 642
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
recursive types broken #187
Comments
import React from "react"
import { types, getSnapshot, applySnapshot, onPatch, applyPatch } from "mobx-state-tree"
import { observer } from "mobx-react"
import { inspect, render } from "mobx-state-tree-playground"
const MstNode = types.model("MstNode", {
value: types.number,
next: types.maybe(types.late(() => MstNode)),
});
const store = MstNode.create({value: 1, next: null})
inspect(store) |
Uhm, yeah, seems to be due to https://github.com/mobxjs/mobx-state-tree/blob/master/src/types/complex-types/object.ts#L113-L117 checks in constructor :/ @mweststrate Do you think it's better to move modelConstructor initialization in first initialize call (and may break extend()) or introduce a flag to determine if type is an identifier? |
New idea: drop completely IdentifierProperty, perform the work on the Identifier type initialize. Will give it a shot later. |
this code:
throws
ReferenceError: MstNode is not defined
fromafter upgrading to 0.7.1.
love your work!
The text was updated successfully, but these errors were encountered: