How to make the arrange list items by dragging?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
34 views
Hello. Question of the kettle. There is a shopping cart online store written in React.
I display a similar table.

How to implement a sorting table rows by drag and drop?
Which library is better to use. Thank you.

import React from 'react' import {connect} from 'react-redux' import R from 'ramda' import {Link} from 'react-router' import { getTotalBasketPrice, getBasketPhonesWithCount, } from 'selectors' import { removePhoneFromBasket, basketCheckout, cleanBasket } from 'actions' const Basket = ({ phones, totalPrice, basketCheckout, removePhoneFromBasket, cleanBasket }) => { const isBasketEmpty = R. isEmpty(phones) const renderContent = () => { return ( {isBasketEmpty && Your shopping cart is empty} {phones.map((phone, index) => ( 
{phone.name}{phone.name}${phone.price}{phone.count} removePhoneFromBasket(phone.id)} /> ))} { R. not(isBasketEmpty) && Total:${totalPrice} } ) } const renderSidebar = () => ( Continue shopping!{ R. not(isBasketEmpty) && } ) return ( {renderContent()} {renderSidebar()} ) } const mapStateToProps = state => { return { phones: getBasketPhonesWithCount(state), totalPrice: getTotalBasketPrice(state) } } const mapDispatchToProps = { basketCheckout, removePhoneFromBasket, cleanBasket } export default connect(mapStateToProps, mapDispatchToProps)(Basket)
by | 34 views

1 Answer

0 like 0 dislike
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
35,430 users