Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/react/src/create-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ const MDXCreateElement = ({
}
MDXCreateElement.displayName = 'MDXCreateElement'

export default function(type, props = {}) {
export default function(type, props) {
const args = arguments
const mdxType = props && props.mdxType

if (typeof type === 'string' || props.mdxType) {
if (typeof type === 'string' || mdxType) {
const argsLength = args.length

const createElementArgArray = new Array(argsLength)
Expand All @@ -44,7 +45,7 @@ export default function(type, props = {}) {
}
}
newProps.originalType = type
newProps[TYPE_PROP_NAME] = typeof type === 'string' ? type : props.mdxType
newProps[TYPE_PROP_NAME] = typeof type === 'string' ? type : mdxType

createElementArgArray[1] = newProps

Expand Down