Skip to content
Discussion options

You must be logged in to vote

Many people found the old behavior unexpected: #821, hence this change.
Because there is an alternative: use Image:

import {compile} from '@mdx-js/mdx'

main()

async function main() {
  const doc = await compile('<Image />')
  console.log(String(doc));
}

You can now pass or provide or import Image:

/*@jsxRuntime automatic @jsxImportSource react*/
import {Fragment as _Fragment, jsx as _jsx} from "react/jsx-runtime";
function MDXContent(props = {}) {
  const _components = Object.assign({}, props.components), {Image, wrapper: MDXLayout} = _components;
  const _content = _jsx(_Fragment, {
    children: _jsx(Image, {})
  });
  return MDXLayout ? _jsx(MDXLayout, Object.assign({}, props, {
    c…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@iAdramelk
Comment options

@wooorm
Comment options

@iAdramelk
Comment options

@iAdramelk
Comment options

@wooorm
Comment options

Answer selected by iAdramelk
Comment options

You must be logged in to vote
0 replies
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