---
search:
  exclude: true
changelog:
  category: Release
  version: 6.3.0
date: '2018-11-28T11:30:54Z'
seo:
  description: >-
    This release enables support for the useInView(ref, options) hook. The
    library will work fine with older versions of React, as long as you don't
    use the…
title: Hooks!
type: changelog
---
This release enables support for the `useInView(ref, options)` hook. The library will work fine with older versions of React, as long as you don't use the execute the hook.

```js
import { useRef } from 'react'
import { useInView } from 'react-intersection-observer'

const Component = () => {
  const ref = useRef()
  const inView = useInView(ref, {
    /* Optional options */
    threshold: 0,
  })

  return (
    <div ref={ref}>
      <h2>{`Header inside viewport ${inView}.`}</h2>
    </div>
  )
}
```

The release also refactors the Rollup build, which should result in a more optimized bundle.
