@mdx-js/runtime
Advanced tools
Comparing version 0.16.5 to 0.16.6
{ | ||
"name": "@mdx-js/runtime", | ||
"version": "0.16.5", | ||
"version": "0.16.6", | ||
"description": "Parse and render MDX in a runtime environment", | ||
@@ -33,4 +33,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@mdx-js/mdx": "^0.16.5", | ||
"@mdx-js/tag": "^0.16.1", | ||
"@mdx-js/mdx": "^0.16.6", | ||
"@mdx-js/tag": "^0.16.6", | ||
"buble": "^0.19.6" | ||
@@ -53,3 +53,3 @@ }, | ||
}, | ||
"gitHead": "4fe045f1c65a3c05a41aac73a0b3918946ce938b" | ||
"gitHead": "fc40de3ea63f58e8453458a54575734f40bcfd90" | ||
} |
@@ -28,2 +28,3 @@ # `@mdx-js/runtime` | ||
// Provide custom components for markdown elements | ||
const components = { | ||
@@ -33,6 +34,16 @@ h1: props => <h1 style={{ color: 'tomato' }} {...props} /> | ||
const mdx = '# Hello, world!' | ||
// Provide custom components that will be referenced as JSX | ||
// in the markdown string | ||
const scope = { | ||
Demo: props => <h1>This is a demo component</h1> | ||
} | ||
const mdx = ' | ||
# Hello, world! | ||
<Demo /> | ||
' | ||
export default () => ( | ||
<MDX components={components}>{mdx}</MDX> | ||
<MDX components={components} scope={scope}>{mdx}</MDX> | ||
) | ||
@@ -39,0 +50,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7202
89
Updated@mdx-js/mdx@^0.16.6
Updated@mdx-js/tag@^0.16.6