Which of the following statements is accurate about React Native's styling system?

4 phương ánCó giải thích

Các phương án trả lời

Chọn một phương án
Lời giảiChọn phương án để mở
Đáp án đúng gồm hai ý: "Every core component in React Native can receive the style prop to apply styling." và "React Native allows you to define styles directly in JavaScript instead of using traditional CSS." Trong React Native, các component lõi như View, Text, Image nhận prop style, và style được viết bằng đối tượng JavaScript với tên thuộc tính dạng camelCase (backgroundColor thay cho background-color), không có tệp CSS. Phát biểu "does not have its own mechanism for managing styles and only uses inline styles" sai vì React Native có StyleSheet.create để khai báo, gom và tái dùng style bên ngoài JSX, không chỉ viết inline. Phát biểu "Core components in React Native do not support the style prop." mâu thuẫn trực tiếp với cách các component lõi được tạo kiểu thông qua prop style.

Cùng chương 4

Xuất hiện trong 1 bộ đề