How to develop a session-based timeout on react.js

How to develop a session-based timeout on react.js
Source: Codementor