Why can’t I `import {}` from `export default {}` in typescript

I have a typescript file:

export default {name: 'name'}

I import it from another file:

import {name} from './util'

It fails to compile with the error util has no exported member name. How should I import it in typescript?

Read more here: https://stackoverflow.com/questions/65710691/why-cant-i-import-from-export-default-in-typescript

Content Attribution

This content was originally published by Joey Yi Zhao at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: