小编ana*_*m__的帖子

在不同的按钮中调用相同的函数,并且两者在 Reactjs、javascript 中都给出不同的输出?

这是我的代码

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)

javascript state onclick reactjs

5
推荐指数
1
解决办法
114
查看次数

标签 统计

javascript ×1

onclick ×1

reactjs ×1

state ×1