我正在使用 react-table 制作简单的 react.js
应用程序。
我尝试使用 npm start
在本地运行它并且运行良好。
但是当我尝试在 github 页面 上部署它时,它只显示一个空白页面。我已按照 deploying react app on gh pages 的所有步骤进行操作。
这里是 gh 存储库:https://github.com/7phalange7/react-table
main
分支有项目代码,gh-pages
分支部署在 github 页面上。
在github页面上部署react-table
会不会有问题?
package.json
供参考
{
"name": "react-table-example",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "^4.0.3",
"react-table": "^7.7.0",
"web-vitals": "^1.1.2",
"homepage": "https://7phalange7.github.io/react-table/"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"gh-pages": "^3.2.3"
}
}
编辑: 仍然不确定这里有什么问题,但我将所有代码复制到一个新的 React 项目,然后部署在 github 页面上,现在工作正常。我猜因为这是第一次部署 React 项目,不知何故我搞砸了一些事情。