Skip to content

Creating a type that accepts a generic map #1928

Answered by EmilTholin
bradherman asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @bradherman!

You could model it as a map of array of strings:

export const Error = types.model('Error', {
  errors: types.map(types.array(types.string)),
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bradherman
Comment options

Answer selected by EmilTholin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants