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
orstyle
props.
Migrating from
v1.x
:๐ If you're not setting a
className
orstyle
, no change is required.๐ Otherwise add your own element as a child and move the
className
orstyle
there. Eg:- before:
<VisibilitySensor className='something' />
- after:
<VisibilitySensor><div className='something' /></VisibilitySensor>
- sensor DOM node is passed in as children rather than the component always rendering its own