-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Pass exports to Layout #379
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
Conversation
|
This pull request is automatically deployed with Now. |
johno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great thanks @mxstbr 🙏.
Had one quick comment we'll need to address, though I don't really have an opinion on whether we remove the spread syntax or polyfill buble (for the runtime).
packages/mdx/mdx-hast-to-jsx.js
Outdated
| ${layout ? `Layout={this.layout} layoutProps={props}` : ''} | ||
| ${ | ||
| layout | ||
| ? `Layout={this.layout} layoutProps={{ ...layoutProps, ...props }}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we might need to tweak this to use Object.assign or configure buble to polyfill:
| ? `Layout={this.layout} layoutProps={{ ...layoutProps, ...props }}` | |
| ? `Layout={this.layout} layoutProps={Object.assign(layoutProps, props)}` |
johno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💟
|
Is this functionality documented anywhere? As the PR isn't that clear on how to make use of it. |
* Pass exports to Layout Closes #378 * Use Object.assign
Closes #378