从容器中导入组件(从范围外)

Importing a component from containers (From outside of the scope)

我对反应很陌生,在解决这个基本问题时遇到了一些麻烦。

来自 HomeLander.js - 如何导入按钮和 P?正如预期的那样,它们不在同一范围内。有没有一个巧妙的方法来做到这一点?

我的目录结构是这样的:

你可以试试这个

import Button from '../../Components/Button'; (given Button component is default export)
import { Button } from '../../Components/Button'; (if Button component is not default export)

与'P'

相同