Skip to content

Conversation

rickhanlonii
Copy link
Member

@rickhanlonii rickhanlonii commented Mar 27, 2024

This would allow setting suppressHydrationWarning on element-ish text nodes:

const obj = {
  $$typeof: Symbol.for('react.element'),
  type: props => props.content,
  ref: null,
  key: null,
  props: {
    suppressHydrationWarning: true,
    content: isClient ? 'Client Text' : 'Server Text',
  },
  toString() {
    return this.props.content;
  },
};

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Mar 27, 2024
@sebmarkbage
Copy link
Collaborator

This isn't rebased and it doesn't cover all cases but I think since this is basically just the same as enabling it everywhere, this is probably safer/easier: #28655

@rickhanlonii
Copy link
Member Author

Yeah your PR is better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants