我已经制作了基本的React组件Persons
,并将其包含在软件包my-react-components
中。但是,当我使用以下方法安装该组件时:
npm install my-react-components
它具有LICENSE,package.json和README.md。但是我的index.js文件丢失了。
这是我要从内部BitBucket存储库安装的软件包。以下是package.json的相关摘录:
"dependencies": {
"react": "^16.11.0","react-dom": "^16.11.0","my-react-components": "latest"
"react-scripts": "3.2.0"
},"repository": {
"type": "git","url": "ssh://git@bitbucket.mycompany.com:7999/~myusername/my-react-components.git"
},
在React组件中,我尝试了各种方法,以便以某种方式导出该组件:
export default Persons;
有什么想法吗?