// Basic JSX file with review issues import React, { useState } from 'react'; // 1. Component không dùng prop types function MyComponent(props) { // 2. State không khởi tạo đúng kiểu const [count, setCount] = useState('0'); // Nên là số // 3. Hàm không dùng function unusedFunc() { return 'unused'; } // 4. Truy cập props không tồn tại const name = props.username; // 5. Render mảng không có key const arr = [1,2,3]; const list = arr.map(item =>
  • {item}
  • ); // 6. Inline style sai cú pháp const style = { color: 'red', fontWeight: 500 }; // 7. Sử dụng biến chưa khai báo let result = value + 1; // 8. Sử dụng setState sai setCount(count++); // 9. Return nhiều phần tử không bọc Fragment return (
    Test {list}

    {name}

    Unwrapped

    ) // Không bọc Fragment } // 10. Export sai kiểu export { MyComponent };