Created
May 30, 2018 09:19
-
-
Save khades/a9057ead5ef431c6cf668ee7fd8ace21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<DragDropContext onDragEnd={this.onDragEnd}> | |
<Droppable droppableId="droppable"> | |
{(provided, snapshot) => ( | |
<div | |
ref={provided.innerRef} | |
style={{ backgroundColor: provided.isDragging ? 'green' : 'lightblue' }} | |
{...provided.droppableProps} | |
> | |
{this.state.fields.map(field => | |
<Draggable key={field.id} draggableId={field.id}> | |
{(provided, snapshot) => ( | |
<div> | |
<div ref={provided.innerRef} {...provided.draggableProps}> | |
<div>HI</div> | |
{/* <ObjectFieldsItem key={field.id} id={field.id} order={field.order} label={field.label} type={field.type} openModal={this.openModal} removeItem={this.removeItem} /> */} | |
</div> | |
{provided.placeholder} | |
</div> | |
)} | |
</Draggable> | |
)} | |
</div> | |
)} | |
</Droppable> | |
</DragDropContext> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment