Skip to content
Discussion options

You must be logged in to vote

The fix was to use evaluate/evaluateSync from @mdx-js like this:

import * as runtime from "react/jsx-runtime";
import { evaluateSync } from "@mdx-js/mdx";

  const { default: Tables } = useMemo(() => {
    return evaluateSync(tables, { ...runtime, remarkPlugins: [remarkGfm] });
  }, [tables]);
  
  return <Tables />;

I think this is one area where the Docusaurus docs could be improved. There's little guidance on how to generate MDX content dynamically.

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by PaulRBerg
Comment options

You must be logged in to vote
1 reply
@slorber
Comment options

slorber Apr 29, 2025
Collaborator

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@slorber
Comment options

slorber Apr 29, 2025
Collaborator

@PaulRBerg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants