react-visibility-sensor v2.0.0 Release Notes

    • sensor DOM node is passed in as children rather than the component always rendering its own <div> (#13)
    • ๐Ÿ’… this also means the component also no longer accepts className or style props.

    Migrating from v1.x:

    ๐Ÿ’… If you're not setting a className or style, no change is required.

    ๐Ÿ’… Otherwise add your own element as a child and move the className or style there. Eg:

    • before: <VisibilitySensor className='something' />
    • after: <VisibilitySensor><div className='something' /></VisibilitySensor>