npm react-resize-detector 4.0.0
v4.0.0

latest releases: 11.0.1, 11.0.0-beta.0, 10.0.1...
5 years ago

The module has been rewritten to be more structured and performant!

BREAKING CHANGES

1. resizableElementId renamed to querySelector.

// Before
resizableElementId="elementId"

// After
querySelector="#elementId"

2. Change Callback pattern function arguments

// Before
<ReactResizeDetector handleWidth>
  {(width, height) => <div />}
</ReactResizeDetector>

// After
<ReactResizeDetector handleWidth>
  {({ width, height }) => <div />}
</ReactResizeDetector>

IMPROVEMENTS

  1. We don't use any side-elements for Child Function Pattern, Child Component Pattern and Render prop pattern. Previously you could find some extra div's in a DOM tree and this could break complex layouts.
  2. Performance optimizations. We use requestAnimationFrame to not overload pages with onResize events. We use PureComponent to optimize RRD's children rerenders. And plenty other tiny improvements.
  3. resizableElementId is replaced by querySelector. Now you can choose any DOM element using querySelector syntax!

Big thanks to @lamhieu-vk for leading and pushing forward this refactoring!

Closes #58, #59, #60

Don't miss a new react-resize-detector release

NewReleases is sending notifications on new releases.