Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jescalan committed Apr 27, 2020
1 parent c3e5a0b commit 1fdfb9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions render-to-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const presetEnv = require('@babel/preset-env')
const presetReact = require('@babel/preset-react')
const pluginBrowser = require('./babel-plugin-mdx-browser')
const nodeEval = require('require-from-string')
const { renderToString } = require('react-dom/server')
const reactRenderToString = require('react-dom/server').renderToString
const React = require('react')

export default function renderToString(source, components) {
Expand Down Expand Up @@ -48,7 +48,7 @@ import { mdx } from '@mdx-js/react'
return {
source: jsSource,
// react: render to string
renderedOutput: renderToString(
renderedOutput: reactRenderToString(
React.createElement(
MDXProvider,
{
Expand Down

0 comments on commit 1fdfb9b

Please sign in to comment.