Automatic JSX runtime In Gatsby(with ts) #2348
Answered
by
hasparus
zhaohuanyuu
asked this question in
Q&A
-
/** @jsx jsx */
import { jsx } from "theme-ui" I configured these in tsconfig.json, but it doesn't work(not try babel-preset): {
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "theme-ui"
}
}
import { Link } from "gatsby"
// sx prop doesn't match in GatsbyLinkProps...
// same on other reactElement
<Link
sx={{
// change gatsby link style
}}
>this is a gatsby link</Link> |
Beta Was this translation helpful? Give feedback.
Answered by
hasparus
Oct 14, 2022
Replies: 1 comment 1 reply
-
You should be able to configure it in your Gatsby config. https://www.gatsbyjs.com/docs/reference/release-notes/v4.1/#jsx-runtime-options-in-gatsby-configjs |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
zhaohuanyuu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should be able to configure it in your Gatsby config.
https://www.gatsbyjs.com/docs/reference/release-notes/v4.1/#jsx-runtime-options-in-gatsby-configjs