Reactjs 在索引文件中重新导出默认导出时,VSCode不建议自动导入

Reactjs 在索引文件中重新导出默认导出时,VSCode不建议自动导入,reactjs,visual-studio-code,import,export,intellisense,Reactjs,Visual Studio Code,Import,Export,Intellisense,我正在开发一个React应用程序来处理这个案子 输入: 文件夹结构: /ProductTypeSelection index.tsx ProductTypeSelectionView.tsx ProductTypeSelectionView.tsx: const ProductTypeSelectionView: React.FunctionComponent<ProductTypeSelectionViewProps> = () => { return <

我正在开发一个React应用程序来处理这个案子

输入

  • 文件夹结构:

    /ProductTypeSelection
      index.tsx
      ProductTypeSelectionView.tsx
    
  • ProductTypeSelectionView.tsx:

    const ProductTypeSelectionView: React.FunctionComponent<ProductTypeSelectionViewProps> = () => {
     return <div />;
    };
    
    export default ProductTypeSelectionView;
    
所需输出
现在我可以像这样导入ProductTypeSelection组件:
import ProductTypeSelection from'src/ProductTypeSelection'
,但是VSCode不建议自动导入ProductTypeSelection(只是ProductTypeSelectionView)

因此,我希望的输出能够使用该导入语法,同时从VSCode获得ProductTypeSelection导入建议。我想知道这是否可以实现,非常感谢。

尝试过
这将工作的预期,但不知道我是否可以重新写在1行这一点

import ProductTypeSelection from "./ProductTypeSelectionView";

export default ProductTypeSelection;

导出默认值,改为尝试:

export { default as ProductTypeSelectionView } from './ProductTypeSelectionView'

使用这种方式,导入语法将是从'src/ProductTypeSelection'导入{ProductTypeSelection}。我想知道是否可以保留此语法
从'src/ProductTypeSelection'导入ProductTypeSelection'
您不能。。除非您正常导入它并将其作为默认值导出<代码>导入产品,导出默认产品谢谢,这是我尝试过的,我将更新问题。
export { default as ProductTypeSelectionView } from './ProductTypeSelectionView'