Replies: 2 comments 2 replies
-
try it /** @jsxImportSource @emotion/react */
// eslint-disable-next-line
import tw from 'twin.macro' |
Beta Was this translation helpful? Give feedback.
2 replies
-
Not sure why you would want to import tw in a mdx file. However, I am able to import a jsx component in a mdx file where the jsx component uses tw. I am using the following in my webpack.config.js: See also: https://giters.com/ben-rogerson/twin.macro/issues/589 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I can‘t seem to figure out why
import 'twin.macro'
isn‘t working when importing: https://raw.githubusercontent.com/ajmalafif/afif.dev/twinmacro-as-shortcodes-for-mdx-afif-521/web/src/content/projects/fare-alert.mdxI‘ve tried few other ways like importing as
shortcodes
like viaLayout
orGlobalStyles
: https://github.com/ajmalafif/afif.dev/blob/9a1ac57b6cd461fe1e004f063c849d5ca6487026/web/src/templates/project-post.js#L19Nothing seems to work. Any pointer or advice?
edit: reckon it has something to do with this? https://www.gatsbyjs.com/docs/using-client-side-only-packages/
Beta Was this translation helpful? Give feedback.
All reactions