We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug report
Sandbox link or minimal reproduction code https://codesandbox.io/s/mobxstatetree-todolist-gj3fx?fontsize=14
Describe the expected behavior in models/LogsStore.js when I use SimpleLog without snapshotProcessor everything is OK,
models/LogsStore.js
SimpleLog
snapshotProcessor
but
when i try use SingleLog with snapshotProcessor in console log throw error:
SingleLog
Uncaught Error: [mobx-state-tree] Failed to resolve reference '2' to type 'SimpleLog' (from node: /highlighted)
Why used references not working with types.snapshotProcessor?
Thanks:)
The text was updated successfully, but these errors were encountered:
Minimum code
export const SimpleLog = types.model("SimpleLog", { id: types.identifier }); export const SingleLog = types.snapshotProcessor(SimpleLog, { preProcessor(sn) { return { id: `${sn.time}` }; } }); export const LogsStore = types.model("Logs", { ref: types.maybe(types.reference(SimpleLog)), obj: SingleLog }); const Logs = LogsStore.create({ ref: "2", obj: { time: "2" } }); const r = Logs.ref;
TODO: add exception when types.reference is not passed a model type? (probably the same for safe ref)
Sorry, something went wrong.
is there any workaround for this issue?
No branches or pull requests
Bug report
Sandbox link or minimal reproduction code
https://codesandbox.io/s/mobxstatetree-todolist-gj3fx?fontsize=14
Describe the expected behavior
in
models/LogsStore.js
when I useSimpleLog
withoutsnapshotProcessor
everything is OK,but
when i try use
SingleLog
withsnapshotProcessor
in console log throw error:Why used references not working with types.snapshotProcessor?
Thanks:)
The text was updated successfully, but these errors were encountered: