import React, { Component } from "react"; import arrayMove from "array-move"; import "./index.scss"; export default class DraggableMessage extends Component { constructor(props) { super(props); this.state = this.props.message; } onSortEnd = ({ oldIndex, newIndex }) => { if (this.props.isActive) this.setState(({ options }) => ({ options: arrayMove(options, oldIndex, newIndex), })); }; render() { const { isActive } = this.props; if (!isActive) return null; return
; } a = ( ); }