Skip to content

Releases: roderickhsiao/react-in-viewport

v1.0.0-beta-1

29 Apr 20:29
147f736
Compare
Choose a tag to compare

What's Changed

Breaking Change Announcement

We are deprecating the use of findDOMNode due to its removal in React's future releases. This change involves shifting the responsibility of accessing the DOM node directly to the component owner. This update affects our HOC implementations and the way refs are handled in both functional and class-based components.

fix #73

What's Breaking

  1. HOC Ref Handling: For enhanced compatibility with both functional and class-based components, HOCs will now return a ReactNode instead of a DOMNode. This change means you must use forwardedRef to attach refs directly to the DOM elements within your components.
  2. Class Component Migration: We recommend migrating away from class-based components when possible due to these changes affecting ref handling.
  3. Ref Propagation: Both class and functional components must now use forwardedRef to directly attach refs to the HTML DOM elements to ensure proper registration.
  4. Hook Update: The useInViewport hook now requires a DOM node to be passed explicitly.

Migration Guide

To adapt to these changes, you'll need to update how refs are passed and used within your components. Below are the examples illustrating the necessary updates:

Before

class A {
  render() {
    return (
       <div />
    )
  }
}

After

class A {
  render() {
    return (
       <div ref={this.props.forwardedRef}/>
    )
  }
}

Full Changelog: v1.0.0-alpha.30...v1.0.0-beta-1

v1.0.0-alph1.30

03 Apr 01:00
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0-alpha.28...v1.0.0-alpha.30

1.0.0-alpha.28

19 May 02:24
Compare
Choose a tag to compare

Regenerate dist file to include updated type definition.

fix #108 (thanks @andyGallagher for reporting)

Full Changelog: v1.0.0-alpha.27...v1.0.0-alpha.28

v1.0.0-alpha.27

02 May 21:24
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.0.0-alpha.26...v1.0.0-alpha.27

v1.0.0-alpha.26

30 Mar 21:35
97ae6a2
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0-alpha.25...v1.0.0-alpha.26

v1.0.0-alpha.25

30 Mar 18:40
2d08bfd
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0-alpha.24...v1.0.0-alpha.25

v1.0.0-alpha.24

30 Mar 17:41
8646cff
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0-alpha.23...v1.0.0-alpha.24

v1.0.0-alpha.23

30 Mar 07:50
063f58d
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0-alpha.22...v1.0.0-alpha.23

v1.0.0-alpha.22

30 Mar 07:33
Compare
Choose a tag to compare

Full Changelog: 1.0.0-alpha.21...v1.0.0-alpha.22

  • Remove flow from dependency

v1.0.0-alpha.21

30 Mar 06:44
Compare
Choose a tag to compare

What's Changed

  • Re-write library in Typescript
  • Update storybook syntax
  • Migrate to Github action

Full Changelog: 1.0.0-alpha.20...1.0.0-alpha.21