In the React Native architecture, what task is the JavaScript Thread responsible for?
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: "Containing and compiling all JavaScript code, running the bundle when the application starts.". Trong kiến trúc cổ điển, React Native có ba luồng chính: JavaScript Thread nạp bundle do Metro đóng gói, đưa cho engine như Hermes hay JavaScriptCore biên dịch và chạy toàn bộ mã JavaScript (component, state, logic, gọi API); Native Thread (UI Thread) vẽ giao diện và nhận thao tác chạm; Shadow Thread tính bố cục. "Executing native code and managing the user interface." sai vì đó là việc của Native Thread, tức main thread của ứng dụng. "Calculating the interface layout using the Yoga tool." sai vì việc tính bố cục bằng Yoga thuộc Shadow Thread. "Managing native modules to ensure they are always ready." sai vì Native Module được khởi tạo và chạy ở phía native, trên hàng đợi riêng của module hoặc Native Thread; JavaScript Thread chỉ gửi lời gọi tới chúng.
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