mapping typescript prop equipment?: Record<string, unknown>; to MST #1750
Unanswered
khein-wherewolf
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Yeah, I dug through the docs and found nothing... It could be really nice to support Here is my ( very crappy and ugly ) workaround: convert the whole equipment data to string to store in the props and then Demo: https://codesandbox.io/s/rxglq?file=/src/index.tsx PS since MST 3+ the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a typescript interface Guest as so:
interface Guest {
...
equipment?: Record<string, unknown>;
...
}
I'm trying to map to MST model:
export const GuestModel = types
.model("Guest")
.props({
...
equipment: types.optional(types.map(types.???), {}),
...
})
Looked at types.custom and IAnyType but really haven't found docs or examples that might show how to use?
Any help and/or push in the right direction would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions