You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.
This will merge supplied props with the plugin's defaults.
So the resulting default props would be
theme: "dark"
align: "left"
since align:"left" is a default used by the theme and not overwitten in gatsby-config.
Would you be interested in this feature/me PRing my branch against this one and supplying more default props (branch currently only merges options for CodePen and Tweet)
The text was updated successfully, but these errors were encountered:
converted .js files to .ts (initially used method that used gatsby-node and thus didn't support TypeScript) and made a useDefaultProps hook that uses the props passed to the component and if they aren't there, falls back to the defaults (either provided by user or the default of the plugin)
It would be neat if users of the plugin could provide their own default props to be used in the components this plugin supplies.
Proof of concept here: https://github.com/NickyMeuleman/gatsby-mdx-embed/tree/default-props
Eg. I want tweets to be dark mode, but don't want to add
theme="dark"
to every tweet I add.Instead I provide some default props via my
gatsby-config
This will merge supplied props with the plugin's defaults.
So the resulting default props would be
since
align:"left"
is a default used by the theme and not overwitten ingatsby-config
.Would you be interested in this feature/me PRing my branch against this one and supplying more default props (branch currently only merges options for
CodePen
andTweet
)The text was updated successfully, but these errors were encountered: