With transclusion, is there any way to use in a second document variables exported in the parent document?
See original GitHub issueMy use case is to have independent mdx
files with the same export const
but different content, and then that each file imports (transcludes) a second mdx
file that acts as a sort of template, but that should use those constants exported in the former (parent) doc
my_mdx_file.mdx
export const title = 'my title'
This is a provided component **Hello** by **MDXProvider**
<Hello />
This template is provided by **MDXProvider**
<Template />
template.mdx
This is the title
<div>{title}</div>
And this is the same component also accessible here
<Hello />
*I can just add a .js
template, but I loss the mdx
format and agility, and that this template should also have access to the same components provided by MDXProvider
(in the js
file I should import them)
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
MultiMarkdown User's Guide - GitHub Pages
A program to convert plain text to a fully formatted document. The syntax used in the plain text to describe how to convert...
Read more >Trying to export a bash variable from an .sh file to another file ...
Source the script (using the . ) to call it in the same shell. You then don't even need to export the value....
Read more >Passing pieces of markup to components in Angular 2 and ...
In this article we'll research how to pass custom markup to Angular components and how to create different types of dynamic components.
Read more >Exporting Variables - SCons
There are two ways to export a variable, such as a construction environment, from an SConscript file, so that it may be used...
Read more >Dependency injection in action - Angular
Angular throws an error if the parent lacks that service, even if a component higher in the component tree includes it. A second...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Completely right 👍
my_mdx_file.mdx
template.mdx
yup!