Open krischer opened 1 year ago
I was using simple markdown (gatsby-transformer-remark) for writing content. But now I want to use advanced markdown (gatsby-plugin-mdx). So I decided to migrate my gatsby app from version 3 to version 5. I successfully migrated the gatsby app. But when trying to migrate remark to mdx, I'm facing critical issues like fileAbsolutePath word doesn't exist, not getting body content of the .md file with children props and not sure what to use for styling markdown content after removing dangerouslySetInnerHTML.
Also facing this issue
Invalid left-hand side in prefix operation. (1:2)
> 1 | ---
| ^
2 | title: Understanding Inline, Inline-Block, and Block Elements in HTML
3 | description: Unlock the secrets of inline, inline-block, and block elements in HTML
4 | date: 2023-07-02
Preliminary Checks
Description
This has been raised in https://github.com/gatsbyjs/gatsby/issues/37777 but I cannot reopen that issue and the original author asked me to open a new issue.
The issue concerns
gatsby-plugin-mdx
and using thecreatePage()
API with the?__contentFilePath=
modifier. It works fine as documented on the website using functional template component. However it does not work when using a react class component.Reproduction Link
https://github.com/krischer/gatsby-mdx-bug-minimal/
Steps to Reproduce
/trial
and it will work using a functional react component./trial
and it will no longer show the contents of the mdx file.this.props.children
isundefined
.Expected Result
I would expect that the functional and the class components behave the same and that
props.children
/this.props.children
has the appropriate content.Actual Result
this.props.children
is empty for class components.Environment
Config Flags
No response