Using Comments in Storybook MDX Files
I've been struggling with this for many months. I've experienced multiple cases where I wanted to add a comment in one of the .mdx
files in my Storybook project but could not found a way to do so. It seems like markdown doesn't really support comments, but because we are using Markdown X, it is apparently possible?
Here is an MDX comment that is working for me now within Storybook:
{/* Your comment here. */}
This looks like a comment, doesn't show any errors in my IDE, and also does not render any HTML. Surprisingly, most of the posts I found online seem to claim this isn't possible, and the only post that did was heavily downvoted... perhaps this is a new feature?
Subscribe to my newsletter
Read articles from Paul Aldrich directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Paul Aldrich
Paul Aldrich
Full-stack developer specializing in React and .NET.