Skip to content

Instantly share code, notes, and snippets.

@alexvcasillas
Created May 17, 2017 10:05
Show Gist options
  • Save alexvcasillas/3445077a27f363fe1d6a4973e81ed044 to your computer and use it in GitHub Desktop.
Save alexvcasillas/3445077a27f363fe1d6a4973e81ed044 to your computer and use it in GitHub Desktop.
Using types.maybe(UserModel) explodes
Uncaught Error: [mobx-state-tree] Error while converting `{"searchName":"","user":{},"repos":[],"fetchingData":false}` to `GithubStore`:
at path "/user" snapshot `{}` is not assignable to type: `UserModel | null`, expected an instance of `UserModel | null` or a snapshot like `({ name: string; bio: (string | null?); avatar: string } | null?)` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment