这是我的代码
const [datatable, setDatatable] = useState({
columns: [
{
label: 'Title',
field: 'title',
width: 200,
attributes: { ariacontrols: 'DataTable', 'aria-label': 'Name' },
},
{ label: 'Language', field: 'language', width: 500 },
{ label: 'Description', field: 'description', width: 200 },
{ label: '', field: 'publish', sort: 'asc', width: 300 },
],
rows: [{ _id: '', title: '', description: '', language: '', publish: '' }],
});
useEffect(() => {
axios.get('/admin/challenges').then((response) => {
data = response.data;
data.map((item) => {
item.publish = (
<Button …Run Code Online (Sandbox Code Playgroud)