0.1.0 • Published 5 years ago
use-toc v0.1.0
useToc
Create easy to use data for building table of content for you react component.
Installation
npm i use-tocor
yarn add use-tocUsage Example
import Toc from ".components/Toc";
import useToc from 'use-toc';
export default function App() {
const toc = usesToc(".container h3");
return (
<div className="App">
<Toc tocData={toc} />
// ...
)
}Demo
0.1.0
5 years ago