Skip to content

Conversation

@snowystinger
Copy link
Member

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@snowystinger snowystinger marked this pull request as ready for review November 5, 2025 22:51
@rspbot
Copy link

rspbot commented Nov 5, 2025

Comment on lines +2 to +9
const glob = require('glob');

let iconFiles = glob.sync('packages/@react-spectrum/s2/{icons,illustrations}/**/*.{cjs,mjs}');
for (let f of iconFiles) {
let contents = fs.readFileSync(f, 'utf8');
contents = contents.replace(/['"]use client['"];?/g, '');
fs.writeFileSync(f, contents);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait so is it a problem if we remove the use client from the icons? #9126 (comment) seems to indicate that they should be client components but I'm not quite familiar with the nature of the nextJS build issue

Copy link
Member Author

@snowystinger snowystinger Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, so it's supported in our docs, which build from src. but it's not supported outside of that yet, so we just remove it, that's why it's removed from the other two files in this script as well, external users must import s2 components in a file that already has use client

don't worry, I asked the same questions when chatting with Devon about how to fix this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha, thanks for the explanation

@snowystinger snowystinger added this pull request to the merge queue Nov 6, 2025
Merged via the queue into main with commit 008dff2 Nov 6, 2025
32 checks passed
@snowystinger snowystinger deleted the fix-useclient-in-s2-icons branch November 6, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants