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
Stateless components cannot use refs, so this adds the withRef option
(enabled by default for compatibility) which enables or disables passing
the wrappedInstance ref to the wrapped component. Addresses issue #30.
Inspired by reduxjs/react-redux@2d3d0be
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,8 @@ or as an [ES7 class decorator](https://github.com/wycats/javascript-decorators)
54
54
-`options.className`**[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)=** Control the class name set on the wrapper `<div>`
55
55
-`options.elementResize`**[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)=** Set true to watch the wrapper `div` for changes in
56
56
size which are not a result of window resizing - e.g. changes to the flexbox and other layout. (optional, default `false`)
57
+
-`options.withRef`**[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)=** Set true to enable accessing the wrapped instance with
58
+
[getWrappedInstance()](https://github.com/digidem/react-dimensions#getwrappedinstance). Disable this when wrapping stateless components, as they cannot use `refs`. (optional, default `true`)
0 commit comments