Skip to content

Releases: NightCafeStudio/react-render-if-visible

v2.1.1

07 Sep 02:51
Compare
Choose a tag to compare
  • Merge pull request #15 from NightCafeStudio/bugfix/memory-leak 418e4c3
  • Fix memory leak, keep local intersection ref b6956e0

v2.1.0...v2.1.1

v2.1.0

14 May 04:02
Compare
Choose a tag to compare
  • Work more reliably with React 17 and 18 2026559

v2.0.2...v2.1.0

v2.0.2

10 May 03:02
Compare
Choose a tag to compare

Potentially breaking change - SSR

In v1.x, the component detected when it was being rendered on the server, and set the initial visible state to true. To work with server-side rendering in React 17+, we no-longer detect the server from within the component, but a new prop initialVisible is exposed which allows you to control whether the child component should be visible on first render or not. This is intended to be used for things like always rendering the first N components as visible, and the rest as not visible (until they're scrolled into view).

Other changes in v2

  • Works with React 17 and 18
  • A new prop - stayRendered (thanks to cyremur) that will keep the element visible after it's been rendered for the first time
  • New props allow you to specify the type of root and placeholder elements (in versions 1.x they were always divs), which allows you to use this package inside tables, etc