usetoc

ReactJs custom-hook for generating table-of-content data.

Usage no npm install needed!

<script type="module">
  import usetoc from 'https://cdn.skypack.dev/usetoc';
</script>

README

useToc

Create easy to use data for building table of content for you react component.

Installation

npm install ---

or

yarn add ---

Usage Example

import Toc from ".components/Toc";
import useToc from '----';

export default function App() {
  const toc = usesToc(".container h3");

  return (
    <div className="App">
      <Toc tocData={toc} />
      // ...
  )
}


Dependencies