Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove imports requirement #2

Open
kentcdodds opened this issue Jan 4, 2019 · 6 comments
Open

Remove imports requirement #2

kentcdodds opened this issue Jan 4, 2019 · 6 comments

Comments

@kentcdodds
Copy link
Contributor

I think you should be able to access the program node which you can use to access the body and insert the imports manually without requiring people to call the imports() function. Wanna give that a try?

@weyert
Copy link
Owner

weyert commented Jan 4, 2019

It's an optional function imports() which you don't need to call. Do I understand you correctly that you are suggesting that I can access the file's main node and add these import statements automatically?

@kentcdodds
Copy link
Contributor Author

Yup! Like this: hamlim/inline-mdx.macro#9

@weyert
Copy link
Owner

weyert commented Jan 4, 2019

Great, thank you! I will have a look at it 🤓

@weyert
Copy link
Owner

weyert commented Jan 5, 2019

I am currently stuck that mdx suddenly generates a class instead of a functional component so the code breaks at the moment. Not sure what's triggering it returning a class 🤔 Ever seen this before, @kentcdodds?

@kentcdodds
Copy link
Contributor Author

Nope 🙃

@weyert
Copy link
Owner

weyert commented Jan 5, 2019

Looks like mdx changed it in v16.1.0 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants