Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- При написании компонента необходимо добавить его реэкспорт в `index.ts` родительской директории:
- ```typescript
- // src/components/YourComponent/YourComponent.tsx
- export interface YourComponentProps {}
- export default class YourComponent extends React.PureComponent<YourComponentProps>
- // src/components/index.ts
- // ...other reexports
- export { default as YourComponent, YourComponentProps } from './YourComponent/YourComponent';
- ```
- Это позволит писать так
- ```diff
- - import YourComponent from 'components/YourComponent/YourComponent';
- - import AnotherComponent from 'components/AnotherComponent/AnotherComponent';
- + import { YourComponent, AnotherComponent } from 'components';
- ```
Add Comment
Please, Sign In to add comment