简体   繁体   English

React 中的 App.js 文件是什么? 文件太长?

[英]What is App.js file in React? The file is way too long?

I wanted to mention that I am new to react and took over the existing project.我想提一下,我是新来的反应并接管了现有项目。 The app.js file in the component folder is too long.组件文件夹中的 app.js 文件过长。 Does this file update by itself, or is it ok to edit the file?该文件是否会自行更新,还是可以编辑该文件?

This is the main file in reactJs.这是 reactJs 中的主文件 It is the parent component of the application.它是应用程序的父组件 All the components of the application are included in app.js .应用程序的所有组件都包含在app.js中。

No, this file does not get updated automatically, you as a developer have to manually update it.不,此文件不会自动更新,您作为开发人员必须手动更新它。

If you want to edit this file then it's ok but as it will help you in exploring the application.如果您想编辑此文件,那没关系,但它会帮助您探索应用程序。 Suppose you remove a component then after running you encountered an error, with this you learn how to resolve the errors.假设您删除了一个组件,然后在运行后遇到错误,您将学习如何解决错误。 And if you want to add new components then you must implement in app.js so that it can be rendered and you can visualize it如果你想添加新组件,那么你必须在app.js中实现,这样它就可以被渲染并且你可以可视化它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM