0
我有一个应用程序,我在数据库中存储图像路径。路径是相对于我的文件系统而不是项目。ReactJS从项目外的文件系统加载图像
当我问题阵营:
<img alt={this.props.alt} src={require('/fs/storage/images/logo.jpg')}/>
I'm收到以下错误:
You attempted to import /fs/storage/images/logo.jpg which falls outside of the project
src/ directory. Relative imports outside of src/ are not supported.
You can either move it inside src/, or add a symlink to it from project's node_modules.
我该如何解决呢?我应该在哪里放置该消息所建议的符号链接?
*的JavaScript。 –