We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 114a664 commit f21ed7fCopy full SHA for f21ed7f
src/Sortable.jsx
@@ -86,6 +86,15 @@ class Sortable extends Component {
86
this.sortable = SortableJS.create(this.node, options);
87
}
88
89
+ shouldComponentUpdate(nextProps) {
90
+ // If onChange is null, it is an UnControlled component
91
+ // Don't let React re-render it by setting return to false
92
+ if (!nextProps.onChange) {
93
+ return false;
94
+ }
95
+ return true;
96
97
+
98
componentWillUnmount() {
99
if (this.sortable) {
100
this.sortable.destroy();
0 commit comments