What file contains the main application logic for a React Native project?
4 phương ánCó giải thích
Các phương án trả lời
Chọn một phương ánLời giảiChọn phương án để mở
Đáp án đúng: "App.js". Trong dự án tạo bằng React Native CLI hoặc Expo, App.js (hoặc App.tsx) chứa component gốc của ứng dụng; index.js gọi AppRegistry.registerComponent để đăng ký component này, và từ đó toàn bộ cây màn hình, điều hướng, state được dựng lên. "package.json" sai vì tệp này khai báo tên dự án, các script và danh sách phụ thuộc cho npm, không chứa logic ứng dụng. "babel.config.js" sai vì đây là cấu hình Babel để biên dịch JSX và cú pháp JavaScript mới, chỉ ảnh hưởng quá trình build. "node_modules" sai vì đây là thư mục chứa mã của các thư viện đã cài, không phải mã của ứng dụng và không nên sửa tay.
Cùng chương 1
Ordering steps in the process of how React Native works in Bridge architecture:
1.The main cable starts working and starts loading JavaScript loads
2.Produces a new DOM (structure) and sends changes to Shadow cable
3.If the JavaScript code is successfully uploaded, the main thread sends it to another JavaScript thread
4.Main thread is able to render something on the screen
5.The shadow string calculates the structure and sends the parameters/properties of the structure to the main sequenceCó lời giảiCâu hỏiReact Native uses the following tech stack to build cross-platform native apps:Có lời giảiCâu hỏiHow does React Native differ from React.js in terms of rendering components?Có lời giảiCâu hỏiCả 54 câu của chủ đề54 câu