
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
react-markdown-tree
Advanced tools
Demo website (demo code on gh-pages branch)
React Markdown Tree renders markdown as customizable React components and never uses dangerouslySetInnerHTML.
commonmark.js and commonmark-react-renderer).react-markdown-tree-config-default for zero setup default styling with syntax highlighting.<MarkdownProvider> and use <Markdown> anywhere in your app with zero props.$ yarn add react-markdown-tree
# OR
$ npm install --save react-markdown-tree
# to use with the default config:
$ yarn add react-markdown-tree-config-default
# OR
$ npm install --save react-markdown-tree-config-default
import React from 'react';
import ReactDOM from 'react-dom';
import { MarkdownProvider } from 'react-markdown-tree';
import markdownConfig from 'react-markdown-tree-config-default';
import App from './App';
ReactDOM.render(
<MarkdownProvider config={markdownConfig}>
<App />
</MarkdownProvider>,
document.getElementById('root'),
);
// App.js or any component that is a child of <MarkdownProvider>
import { Markdown } from 'react-markdown-tree';
...
render() {
return (
<Markdown>
{this.state.stringInMarkdownFormat /* any string containing the markdown source to render */}
</Markdown>
);
}
You can also use the UMD build that's available from Unpkg:
<!-- Available at window.ReactMarkdownTree -->
<script src="https://unpkg.com/react-markdown-tree/dist/react-markdown-tree.min.js"></script>
<!-- Available at window.ReactMarkdownTreeConfigDefault -->
<script src="https://unpkg.com/react-markdown-tree-config-default/dist/react-markdown-tree-config-default.min.js"></script>
<Markdown>children: string<Markdown> returns null and does not renderas: string | ReactComponent'div''div' will render a <div> container, 'section' will render a <section> container, etc...<div>ReactComponent instead of a string, the rendered markdown will be passed down as an array of children to that component...restclassName, style, etc...<Markdown as="section" className="some-markdown"># Some Heading</Markdown> will render on the page as <section class="some-markdown"><h1>Some Heading</h1><section/><MarkdownProvider>config: objectrenderers and containerProps<MarkdownProvider> is mounted, and you cannot change the config once it has been set.referenceMarkdownConfigWithUnstyledRenderers.jsconst config = {
renderers: {
Heading: /* ReactComponent */,
Paragraph: /* ReactComponent */,
Link: /* ReactComponent */,
Image: /* ReactComponent */,
List: /* ReactComponent */,
Item: /* ReactComponent */,
BlockQuote: /* ReactComponent */,
Emph: /* ReactComponent */,
Strong: /* ReactComponent */,
Softbreak: /* ReactComponent */,
Linebreak: /* ReactComponent */,
ThematicBreak: /* ReactComponent */,
Code: /* ReactComponent */,
CodeBlock: /* ReactComponent */,
},
containerProps: {
// default props passed down to every instance of <Markdown>
// see <Markdown> API for prop definitions
},
};
FAQs
Markdown provider and component for React
The npm package react-markdown-tree receives a total of 0 weekly downloads. As such, react-markdown-tree popularity was classified as not popular.
We found that react-markdown-tree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.