-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby): disable automatic by default #27615
Conversation
Emotion will support it very soon. emotion-js/emotion#1970 |
This should have been a major version bump. I've upgrade my whole site already and now need to undo all the configurations again if I want to be able to upgrade Not just undo actually. Because the new things I've added later never had |
@KyleAMathews you can't go around selling that Gatsby has the new JSX Transform and actually having this stated in the React docs and then disable without any warning. Gatsby is not a personal blog framework. Big companies depend on it |
@frontendphil add this to your gatsby-node.js and you should be fine exports.onCreateBabelConfig = ({ actions }) => {
actions.setBabelPlugin({
name: '@babel/plugin-transform-react-jsx',
options: {
runtime: 'automatic',
},
});
}; |
Unfortunately @Bartmr solution doesn't works for me on Gatsby 3 |
create a babelrc file in your gatsby root with the following
|
This worked for me. I created
|
Not sure why, but this didn't work for me. However, this worked:
I.e. exactly like #27615 (comment) but in a babel config file instead of |
For anyone coming across this now, you can enable the automatic JSX transform with the // gatsby-config.js
module.exports = {
jsxRuntime: "automatic",
}; |
Description
Disable automatic react runtime option by default. The ecosystem hasn't adapted yet, projects like theme-ui, mdx, .. haven't adopted it yet. When people us react@17, their site might break
#27468 (comment)
You can test it by adding the following to a page and using react, react-dom