Closed goranmandiccrs closed 4 years ago
// non runtime type checked enum
testEnum: prop<TestEnum>(),
// runtime type checked enum
testEnum2: tProp(types.enum(TestEnum))
the problem was trying to use types.
inside the generic part
I actually suspected this, but looking up "using dot inside generics" wasn't giving me good results, plus I couldn't figure out how to do it properly- obviously. Thank you- I'll be closing this issue now.
Hi! Loving, the library so far- trying to move away from MST into something similar but with better performance and type support, so thanks for your effort! I have an issue when trying to expose
types.enum
as my prop type. Here's a sandbox that illustrates my Typescrtipt issue: https://codesandbox.io/s/mobx-keystone-test-nfc5c?file=/src/index.tsWhen I try importing the default mobx-keystone export, and access types as
Keystone.types
, I get this message:TS2694: Namespace '"C:/Users/gman/source/Zeus/node_modules/mobx-keystone/dist/index"' has no exported member 'types'
How should I go about declaring enum props?