forumone / gesso

Gesso Drupal theme
66 stars 13 forks source link

React import now required for stories using JSX decorators #831

Closed kmonahan closed 3 months ago

kmonahan commented 3 months ago

Something with the Storybook 8 upgrade has caused stories that use JSX in a decorator (example: button.stories.jsx) to individually import React in that file. Error message that displays otherwise seems to be connected to pmmmwh/react-refresh-webpack-plugin. Desired behavior is to not have to keep importing React to use JSX.

coreylafferty commented 3 months ago

To temporarily remedy this, I added import React from 'react'; to the top of the following stories:

back-to-top.stories.jsx
button.stories.jsx
icon.stories.jsx

Additionally, in gesso-uswds, I also added it to the following stories in the USWDS folder:

alert.stories.jsx
button.stories.jsx
dcmouyard commented 3 months ago

PR I just created might fix this issue: #837