react-toc-hash-link
: THIS NPM IS BASED ON react-toc
: JUST ADDED url parameter
and react-router-hash-link
ON HERE
Installation
npm install --save react-toc-hash-link
import React from "react";
import Toc from "react-toc-hash-link";
const Example = () => {
const yourMarkdownText = "# test \n your markdown Content # test2\n";
return <Toc markdownText={yourMarkdownText} className={"customClassName"} url={url}/>;
};
export default Example;
: Toc
will return a
tag as HashLink
in react-router-hash-link
: It will make you can use Anchor Link
on React Project
Example
const markdownText = '### 3. This is Example';
...
return <Toc markdownText={markdownText} url={'/post'}/>;
:blank
will be replace to '-' on href Anchor url
(url in url parament has no difference)
: result a tag
is adjusted as HashLink
in react-router-hash-link