Fetching contributors…
Cannot retrieve contributors at this time
43 lines (36 sloc) 2.76 KB


Sensors are render pros that track some behavior and re-render on state change.

For example, the below <div> will be re-rendered every time mouse position changes.

  {({posX, posY}) => <div />}

libreact comes with plenty of sensors built-in.

Most sensors have also corresponding HOC and class decorator that provide the same functionality. For example, <NetworkSensor> render prop component has a corresponding withNetowrk() HOC and @withNetwork decorator.