You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+15
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,7 @@ The module exports the following:
97
97
-`MenuItem`
98
98
-`SubMenu`
99
99
-`monitor`
100
+
-`connect`
100
101
101
102
102
103
### ContextMenu(props)
@@ -223,6 +224,20 @@ Type: `Function`
223
224
224
225
A utility function to hide the currently active contextmenu programmatically.
225
226
227
+
### connect(Menu)
228
+
229
+
Type: `Function`
230
+
231
+
Returns: React Component
232
+
233
+
A simple wrapper to be used when different items must be rendered based on which component was (right) clicked.
234
+
235
+
**Menu**
236
+
237
+
Type: React Component
238
+
239
+
The `Menu` component that needs to be updated depending on the current selection. The component will receive object from `monitor.getItem()` in its props with `item` as key. All the other props will be simply passed through.
240
+
226
241
## Credits
227
242
This project is based on the ideas from [react-dnd](https://github.com/gaearon/react-dnd) by [Dan Abramov](https://github.com/gaearon).
0 commit comments