Soon to be deprecated, it is recommended to use entry.[tj]s。
The identifier for the entry point when the application uses custom bootstrap.
In general, the App.[tj]sx hook file can already meet our needs. When we need to add custom behavior before bootstrap or completely take over the webpack packaging entry, we can place index.[tj]s in the src or entry directory. There are two cases below:
Just export a function in src/index.[tj]s:
When there is no default export function in src/index.[tj]sx?, the file is the real webpack packaging entry file and the code can be organized directly as using create-react-app and other scaffolding tools: