@yeskunall/react-dom-status-hook

React hook for subscribing to document.readyState

Usage no npm install needed!

<script type="module">
  import yeskunallReactDomStatusHook from 'https://cdn.skypack.dev/@yeskunall/react-dom-status-hook';
</script>

README

@yeskunall/react-dom-status-hook

React hook for subscribing to document.readyState

Note: This is using the new React Hooks API Proposal which is subject to change until React 16.7 final.

You'll need to install react, react-dom, etc at ^16.7.0-alpha.0

Install

npm

npm i -S @yeskunall/react-dom-status-hook

Yarn

yarn add @yeskunall/react-dom-status-hook

Usage

import useDOMState from '@yeskunall/react-dom-status-hook';

function MyComponent() {
  let readyState = useDOMState();
  // {
  //   readyState: document.readyState,
  // }

  // ...
}

21kb-sponsor