reactjs-popup icon indicating copy to clipboard operation
reactjs-popup copied to clipboard

Warning: Prop `aria-describedby` did not match. Server: "popup-212" Client: "popup-1"

Open tabzam opened this issue 2 years ago • 7 comments

Screen Shot 2021-09-06 at 12 08 57 am

why would this error appear. it was working fine and then suddenly this started appearing. the aria-describedby="popup-212" changes everytime i refresh.

Version

Test Case

Expected Behavior

Actual Behavior

tabzam avatar Sep 05 '21 14:09 tabzam

I'm having the same error, don't know why.

datsfilipe avatar Oct 14 '21 02:10 datsfilipe

if someone is facing the same problem, the solution for me was to follow what was said in #215

datsfilipe avatar Oct 14 '21 04:10 datsfilipe

This situation is similar to this issue and the reason is also described there.

Here this line is causing the issue

Kingkon963 avatar Dec 20 '21 20:12 Kingkon963

Same issue, workarounds that involve id="unique-anything" and isLazy don't help.

Bug-Reaper avatar Jan 27 '22 09:01 Bug-Reaper

Starting with React 18 you can fix this by replacing ++popupIdCounter with useId() in here.

Context on useId(): https://reactjs.org/docs/hooks-reference.html#useid

vhpoet avatar Apr 19 '22 05:04 vhpoet

https://github.com/yjose/reactjs-popup/issues/215#issuecomment-1332724293

lukacspapp avatar Nov 30 '22 21:11 lukacspapp

As a temp fix, you could use a wrapper in order to clean up aria-describedby. Until someone sends a pr with fix for this issue.

const TriggerWrapper = React.forwardRef((props, ref) => {
  return React.cloneElement(props.children, {
    ref,
    onMouseEnter: props.onMouseEnter,
    onMouseLeave: props.onMouseLeave,
    'aria-describedby': '0'
  });
});

nesterow avatar Feb 28 '23 06:02 nesterow