Skip to content

Add recipe for loading markdown#210

Merged
patricklafrance merged 1 commit intodilanx:masterfrom
c-w:recipe-markdown-loader
Nov 3, 2020
Merged

Add recipe for loading markdown#210
patricklafrance merged 1 commit intodilanx:masterfrom
c-w:recipe-markdown-loader

Conversation

@c-w
Copy link
Contributor

@c-w c-w commented Nov 3, 2020

This pull request adds a recipe for how to use craco to support loading of markdown into your React application which enables code similar to the following:

import myMarkdownAsHtml from './myMarkdown.md';

const MyComponent = () => <div dangerouslySetInnerHTML={{ __html: myMarkdownAsHtml }} />;

Note that Typescript users should additionally include the following in their index.d.ts file:

declare module '*.md';

@patricklafrance patricklafrance merged commit 1fea189 into dilanx:master Nov 3, 2020
@patricklafrance
Copy link
Contributor

Thanks for the recipe :)

@c-w c-w deleted the recipe-markdown-loader branch November 3, 2020 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants