我开始玩Create React App,但我无法理解它index.js
是如何加载的index.html
.HTML代码是这样的:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tag above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a …
Run Code Online (Sandbox Code Playgroud) 我想知道是否应该直接在index.js 文件中实现主页,或者是否应该在pages 文件夹中创建一个单独的“home-page.js”文件。index.js 文件仅仅是应用程序的起点还是我应该将其用作页面本身?或者我应该从index.js 重定向到我的主页?next.js 与react.js 中的index.js 文件有哪些不同的用例?我没有任何经验,想听听一些最佳实践或需要注意的事项。