Render markdown files as React Components
Unanswered
Corn Crake posted this in #help-forum
Corn CrakeOP
Currently I'm importing my markdown file and I need it to render as HTML, I'm using
I already set up the
This is my
react-markdown for that. But when launching the application locally I'm getting this errorsYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file I already set up the
@next/mdx, I don't really know what to do now and I need some guidance on this topicThis is my
next.configconst withMDX = require('@next/mdx');
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
dangerouslyAllowSVG: true,
contentDispositionType: 'attachment',
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
},
pageExtensions: ['md', 'mdx', 'tsx'],
};
module.exports = withMDX(nextConfig);