Hello,
I’m building a small project with PatternFly4 react seed [1] and I’ve been trying to find the proper way to load/embed markdown (.md files) the proper way in typescript.
Since the project uses webpack I’ve added the following loaders to the webpack.dev.js file module rules.
{test: /.md$/,
use: [
{
loader: ‘html-loader’,
},
{
loader: ‘markdown-loader’,
},
],
}
// Also added the following to typings.d.ts
declare module ‘*.md’;
I’ve tried the following without any luck
BlogPost1.tsx
import * as React from ‘react’;
import { PageSection, Title, TextContent } from ‘@patternfly/react-core’;
import readme from “./README.md”
// builds properly but does not display markdown, just html/text content, as expected.
const BP1: React.FunctionComponent = () => (
PageSection>
TextContent>
{readme}
TextContent>
PageSection>
);
// no luck either
// function BP1() {
// return(
//
// );
// }
export { BP1 }
Any ideas on how to solve this?
[1] https://github.com/patternfly/patternfly-react-seed
Cheers,
Ricardo