Comments (6)
It's at least this line:
This kind of a patch helped to get rid of it in our project:
diff --git a/dist/react-beautiful-dnd.esm.js b/dist/react-beautiful-dnd.esm.js
index ecced698aefb8b8e97a196195ef77955941e0b72..4753f5f9ba6c92969c6fa8bf81eb2fda389b4c72 100644
--- a/dist/react-beautiful-dnd.esm.js
+++ b/dist/react-beautiful-dnd.esm.js
@@ -8235,7 +8235,18 @@ function PublicDraggable(props) {
}));
}
-function Droppable(props) {
+function Droppable(passedProps) {
+ var defaultProps = {
+ mode: 'standard',
+ type: 'DEFAULT',
+ direction: 'vertical',
+ isDropDisabled: false,
+ isCombineEnabled: false,
+ ignoreContainerClipping: false,
+ renderClone: null,
+ getContainerForClone: getBody
+ };
+ var props = { ...defaultProps, ...passedProps };
var appContext = useContext(AppContext);
!appContext ? process.env.NODE_ENV !== "production" ? invariant(false, 'Could not find app context') : invariant(false) : void 0;
var contextId = appContext.contextId,
@@ -8494,21 +8505,10 @@ function getBody() {
return document.body;
}
-var defaultProps = {
- mode: 'standard',
- type: 'DEFAULT',
- direction: 'vertical',
- isDropDisabled: false,
- isCombineEnabled: false,
- ignoreContainerClipping: false,
- renderClone: null,
- getContainerForClone: getBody
-};
var ConnectedDroppable = connect(makeMapStateToProps$1, mapDispatchToProps$1, null, {
context: StoreContext,
pure: true,
areStatePropsEqual: isStrictEqual
})(Droppable);
-ConnectedDroppable.defaultProps = defaultProps;
export { DragDropContext, PublicDraggable as Draggable, ConnectedDroppable as Droppable, resetServerContext, useKeyboardSensor, useMouseSensor, useTouchSensor };
from react-beautiful-dnd.
Same here. I don't know exactly what is causing this.
Warning: Connect(Droppable): Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.
from react-beautiful-dnd.
@peruukki can you make it a PR please ? π
from react-beautiful-dnd.
I've understood this project is being sunsetted and replaced with Pragmatic drag and drop (see #2573), and no further development will be done apart from security fixes. The README says:
We recommend that you donβt raise issues or pull requests, as they will not be reviewed or actioned until further notice.
So it seems patching the package (via e.g. patch-package
or yarn patch
/pnpm patch
) is the most convenient way to solve this.
from react-beautiful-dnd.
Hi, I have tried to change the file with the patch-package. Thanks for the suggestion.
However, I get this error now:
Uncaught ReferenceError: Droppable is not defined
at ./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js (react-beautiful-dnd.esm.js:7340:1)
any thoughts what might be the case here?
from react-beautiful-dnd.
Hi, I have tried to change the file with the patch-package. Thanks for the suggestion. However, I get this error now:
Uncaught ReferenceError: Droppable is not defined at ./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js (react-beautiful-dnd.esm.js:7340:1)
any thoughts what might be the case here?
Could be some syntactic error with the changes, though the source line 7340 is surprising because Droppable
is only referenced at the almost end of the file where the line numbers go over 8000, but maybe you have something in your pipeline transforming it afterwards.
One thing you could try is applying the changes with the standard patch
command if it's available in your system:
- Reset all changes you've made in
react-beautiful-dnd
- Go to the installed package directory:
cd node_modules/react-beautiful-dnd
- Apply the patch:
patch << 'EOF'
diff --git a/dist/react-beautiful-dnd.esm.js b/dist/react-beautiful-dnd.esm.js
index ecced698aefb8b8e97a196195ef77955941e0b72..4753f5f9ba6c92969c6fa8bf81eb2fda389b4c72 100644
--- a/dist/react-beautiful-dnd.esm.js
+++ b/dist/react-beautiful-dnd.esm.js
@@ -8235,7 +8235,18 @@ function PublicDraggable(props) {
}));
}
-function Droppable(props) {
+function Droppable(passedProps) {
+ var defaultProps = {
+ mode: 'standard',
+ type: 'DEFAULT',
+ direction: 'vertical',
+ isDropDisabled: false,
+ isCombineEnabled: false,
+ ignoreContainerClipping: false,
+ renderClone: null,
+ getContainerForClone: getBody
+ };
+ var props = { ...defaultProps, ...passedProps };
var appContext = useContext(AppContext);
!appContext ? process.env.NODE_ENV !== "production" ? invariant(false, 'Could not find app context') : invariant(false) : void 0;
var contextId = appContext.contextId,
@@ -8494,21 +8505,10 @@ function getBody() {
return document.body;
}
-var defaultProps = {
- mode: 'standard',
- type: 'DEFAULT',
- direction: 'vertical',
- isDropDisabled: false,
- isCombineEnabled: false,
- ignoreContainerClipping: false,
- renderClone: null,
- getContainerForClone: getBody
-};
var ConnectedDroppable = connect(makeMapStateToProps$1, mapDispatchToProps$1, null, {
context: StoreContext,
pure: true,
areStatePropsEqual: isStrictEqual
})(Droppable);
-ConnectedDroppable.defaultProps = defaultProps;
export { DragDropContext, PublicDraggable as Draggable, ConnectedDroppable as Droppable, resetServerContext, useKeyboardSensor, useMouseSensor, useTouchSensor };
EOF
- Create the project patch file in the project directory, for example
cd ../.. && npx patch-package react-beautiful-dnd
from react-beautiful-dnd.
Related Issues (20)
- Trouble with Antd Menu HOT 2
- What is the use of mode virtual HOT 1
- Cards overlapping when I drag react-beautiful-dnd HOT 3
- Change the position of the Session Card that is being dragged to the right of the mouse
- When dragging the item, the element's size and the drop area are not being recognized at their respective sizes. HOT 2
- Cannot scroll to the bottom of the list when working with react-window VariableSizeList
- Nested horizontal dropzone doesn't work correctly
- where is the demo code and API? HOT 1
- The ui gets distorted when I drag and drop.
- Want to disable nesting tree for some nodes
- Drag and drop not working new window created through createPortal
- Tasks go on top of column title after dragging HOT 1
- Setting position issue -- When the page is scroll with position: Sticky, The drag component is not positioning properly.
- Droppable should only accept Draggables of same type ... but it doesn't work HOT 1
- Dragging Item while scrolling is not staying in the position with Tailwind CSS
- Update: 3rd April 2024 β "react-beautiful-dnd: where to from here?" HOT 7
- Unable to work in Next.js 14
- While dragging inner child below parent also moving upward HOT 1
- How to restrict draggable item moving out of parent div?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-beautiful-dnd.