Dịch thoát ý là được, không cần phải dịch từng từ.
Ví dụ lấy từ bài JSX in Depth
Đoạn gốc
if statements and for loops are not expressions in JavaScript, so they can't be used in JSX directly. Instead, you can put these in the surrounding code. For example:
function NumberDescriber(props) {
let description;
if (props.number % 2 == 0) {
description = <strong>even</strong>;
} else {
description = <i>odd</i>;
}
return <div>{props.number} is an {description} number</div>;
}
Dịch
if và for không phải là expression trong JavaScript, do vậy không dùng trực tiếp trong JSX được, mà hãy xử lý trước khi đưa vào JSX như bên dưới:
Dịch thoát ý là được, không cần phải dịch từng từ.
Ví dụ lấy từ bài JSX in Depth
Đoạn gốc
ifstatements andforloops are not expressions in JavaScript, so they can't be used in JSX directly. Instead, you can put these in the surrounding code. For example:Dịch
ifvàforkhông phải là expression trong JavaScript, do vậy không dùng trực tiếp trong JSX được, mà hãy xử lý trước khi đưa vào JSX như bên dưới: