Попытка создать перетаскиваемую таблицу / список, и она выдает ошибку, в которой говорится, что «ман.иннерRef не был предоставлен с HTMLElement ». - PullRequest
0 голосов
/ 26 апреля 2019

Я пытаюсь создать перетаскиваемый список, используя Material UI и Reaction-Beautiful-DDD. Я следовал за руководством на их странице и создал это -

function DraggableList(props) {
  const { classes, tableHeaders, tasksList } = props;
  return (
    <div>
      <Droppable droppableId="id">
       {(provided) => (
         <div ref={provided.innnerRef} {...provided.droppableProps}>  
           {tasksList && tasksList.slice(0,5).map((row, index) => (
              <Draggable draggableId={row.id} index={index}>
                {(provided)=> (
                  <div index={index} {...provided.draggableProps} {...provided.dragHandleProps} ref={provided.innerRef}> 
                    <Paper className={classes.root} key={row.id}>
                      <Grid container xs={12} className={classes.topContainer}>
                        <Grid item xs={2}>
                          <IconButton><DragIndicatorIcon className={classes.dragIcon}/></IconButton> </Grid>
                        <Grid item xs={10}>
                          <Typography className={classes.activity} variant="body2">{row.name}</Typography>
                        </Grid>
                      </Grid>
                    </Paper>
                   </div>
                )}
              </Draggable>
            ))}
          </div>
        )}
      </Droppable>
    </div>
  );
}

Это продолжает давать мне

Error: Invariant failed: 
    provided.innerRef has not been provided with a HTMLElement.

    You can find a guide on using the innerRef callback functions at:
    https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/using-inner-ref.md

ошибка, хотя я устанавливаю innerRef на 'div'. В чем здесь ошибка

...