Skip to content

Commit 7d749e8

Browse files
committed
feat(ObserveBoundingClientRect): deprecate component
1 parent 295dc96 commit 7d749e8

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The project aims to support recent releases of v8 and v10 and higher of NodeJS.
6060
* [`NEW useScroll`](docs/api/ObserveViewport_connectViewport_useViewport.md#hooks-useviewport-usescroll-usedimensions-useLayoutSnapshot)
6161
* [`NEW useDimensions`](docs/api/ObserveViewport_connectViewport_useViewport.md#hooks-useviewport-usescroll-usedimensions-useLayoutSnapshot)
6262
* [`NEW useLayoutSnapshot`](docs/api/ObserveViewport_connectViewport_useViewport.md#hooks-useviewport-usescroll-usedimensions-useLayoutSnapshot)
63-
* [`ObserveBoundingClientRect`](docs/api/ObserveBoundingClientRect.md)
63+
* [`ObserveBoundingClientRect (deprecated)`](docs/api/ObserveBoundingClientRect.md)
6464
* [Types](docs/api/types.md)
6565

6666
### Concepts

docs/api/ObserveBoundingClientRect.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# ObserveBoundingClientRect
1+
# ObserveBoundingClientRect (deprecated)
22

33
Observes for changes to the bounding client rect of a given reference.
44

5-
**!!! Be careful with this component. It can cause really bad performance if overused and needs a refactoring !!!**
5+
**!!! Be careful with this component, it can cause really bad performance if overused. Therefor it is deprecated and will be removed with the next mayor release, it is recommended to switch to the new useReact or useReactEffect hooks instead !!!**
66

77
``` javascript
88
import * as React from 'react';

lib/ObserveBoundingClientRect.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ interface IState extends IRect {
3232
isInitialized: boolean;
3333
}
3434

35+
/**
36+
* @deprecated Use useRect or useRectEffect instead as it provides better performance.
37+
*/
3538
export default class ObserveBoundingClientRect extends React.PureComponent<
3639
IProps,
3740
IState

0 commit comments

Comments
 (0)