s-ong-c / tip

1 stars 0 forks source link

[Migrating to React 17 and Fixing the JSX Runtime Error with Emotion] #11

Open s-ong-c opened 3 years ago

s-ong-c commented 3 years ago
스크린샷 2021-01-07 오후 8 58 46

[environment] storybook ^6.1.11 emotion "^11.1.1" react 17

/ jsx / fragment error 발생

refer

https://github.com/system-ui/theme-ui/issues/1160 https://github.com/doczjs/docz/issues/1579 https://github.com/emotion-js/emotion/issues/2041

sovled

(https://dev.to/segunadebayo/migrating-to-react-17-and-fixing-the-jsx-runtime-error-with-emotion-l4n)[https://dev.to/segunadebayo/migrating-to-react-17-and-fixing-the-jsx-runtime-error-with-emotion-l4n]

1.

/** @jsxRuntime classic /
/** @jsx jsx */

2.

/** @jsxImportSource @emotion/core */

3.

{
  "presets": ["@emotion/babel-preset-css-prop"]
}
elsaulio commented 3 years ago

you can also put in your .env file DISABLE_NEW_JSX_TRANSFORM = true and get rid of the /** @jsxRuntime classic /