最佳答案
Coming from Java to TS, I've omitted the {...}
around the imported type.
import DiscriminatorMappingData from './DiscriminatorMappingData';
instead of
import {DiscriminatorMappingData} from './DiscriminatorMappingData';
See TypeScript - storing a class as a map value?.
I've read the documentation and didn't understand much. I only took from it that when I only need one type from a file, I can omit the {}
.
However, that caused weird errors, like "Unknown name", or unexpected type incompatibilites.
So, what's the difference, put simply?