Why this work
import ActionButton from './components/atom/ActionButton'
And this not?
export ActionButton from './components/atom/ActionButton'
The line above give me the error:
Cannot find name 'ActionButton'.ts(2304)
My directory structure
.
├── components
│ ├── atom
│ │ ├── ActionButton
│ │ │ ├── ActionButton.spec.tsx
│ │ │ ├── ActionButton.stories.tsx
│ │ │ ├── ActionButton.styles.tsx
│ │ │ ├── ActionButton.tsx
│ │ │ └── index.ts
Where on index.ts
I have
export { default } from './ActionButton'
CodePudding user response:
Change it to export { default as ActionButton } from './components/atom/ActionButton'
as ActionButton has no named export.