Skip to content

Conversation

@reidbarber
Copy link
Member

Closes #3250

Not a huge deal, just cleaning up some old issues. We can close if we think this isn't worth including since we now only show in production.

✅ 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:

@rspbot
Copy link

rspbot commented Aug 6, 2025

@reidbarber reidbarber added this pull request to the merge queue Aug 6, 2025
if (placeholder && process.env.NODE_ENV !== 'production') {
console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/SearchField.html#help-text');
}
let hasWarned = useRef(false);
Copy link
Member

Choose a reason for hiding this comment

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

make into a usePlaceholderWarning({placeholder, message}) hook?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking a larger dev-only runtime hook might be useful? Maybe we can think more about this.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, i was just thinking to reduce code size as a result of duplication

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

also ok with it as is

Merged via the queue into main with commit f652637 Aug 6, 2025
32 checks passed
@reidbarber reidbarber deleted the placeholder-warning-render branch August 6, 2025 23:38
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.

Issue placeholder deprecation warning only on initial component render

6 participants