---
search:
  exclude: true
changelog:
  category: Release
  version: 8.33.0
date: '2021-12-09T22:55:01Z'
seo:
  description: >-
    add support for fallbackInView (#521) (aa50422) - Closes #495 This is
    solution for #495 that adds support for a fallbackInView value. You can set
    the fallback…
title: v8.33.0
type: changelog
---
# [8.33.0](https://github.com/thebuilder/react-intersection-observer/compare/v8.32.5...v8.33.0) (2021-12-09)


### Features

* add support for `fallbackInView` ([#521](https://github.com/thebuilder/react-intersection-observer/pull/521)) ([aa50422](https://github.com/thebuilder/react-intersection-observer/commit/aa504225873b7441b80b73f7f3ddc4f959b303a0)) - Closes #495 

This is solution for #495 that adds support for a `fallbackInView` value.

You can set the fallback globally:

```js
import { defaultFallbackInView } from 'react-intersection-observer';
defaultFallbackInView(true); // or 'false'
```

You can also define the fallback locally on `useInView` or `<InView>` as an
option. This will override the global fallback value.

```jsx
import React from 'react';
import { useInView } from 'react-intersection-observer';

const Component = () => {
  const { ref, inView, entry } = useInView({
    fallbackInView: true,
  });

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