Licence
MIT
Version
0.1.1
Deps
2
Size
3 kB
Vulns
3
Weekly
0
use-markdown
A React hook to load Markdown files.
Features
- Loads a markdown file then parses with
marked. - Returns the parsed markdown.
Demo
Install
# Using yarn
yarn add @osequi/use-markdown
# or, using npm
npm i @osequi/use-markdown
Usage
// demo/src/App.js
import useMarkdown from "use-markdown";
import readme from "./README.md";
const App = () => {
const { markdown } = useMarkdown(readme);
const html = <div dangerouslySetInnerHTML={{ __html: markdown }} />;
return <>{html}</>;
};
Test
In /demo there is a Create React App.
Changelog
Please check CHANGELOG.md.
Generated with Unleash using Conventional changelog and Semantic versioning.