Closed harryfino closed 4 years ago
It looks like this error is caused by top-middle
not being supported in v2. I switched to top
instead and it worked correctly. I'm closing the issue, but keeping this around in case someone else runs into this problem.
top-middle
was never supported, the placements have always been top-start
, top
, top-end
Maybe it was a typo that I made a long time ago, but I was never punished for it in v1 and it placed the popper in the correct position. The error handling is v2 did not tell me this was invalid and sent me on a goose chase for hours. Maybe something like this would go a long way?
Popper.propTypes = {
placement: PropTypes.oneOf([
'top-start',
'top',
'top-end',
...
])
};
In my components, this helps prevents me from passing in the wrong text.
Anyway, cheers and thank you for a great library!
We ship Flow and TS type defs that should warn you about this, PropTypes are basically deprecated at this point.
The legacy class components are not working correctly when updating from v1.3.7 to v2.x. I'm using the
referenceElement
property in the<Popper>
component and something isn't working correctly.Reproduction demo
This link shows a working example of Popper as a tooltip when you hover over the word "editing". https://codesandbox.io/s/legacy-popper-usage-m5v83?file=/src/App.js
When you change to
react-popper
to v2.x in the dependencies on the left, this example starts failing on mouseover with the errorCannot read property 'x' of undefined
.Steps to reproduce the problem
Hover over the word "editing" and observe the correct behavior using v1.3.7 of
react-popper
Switch dependencies to v.2.2.3 of
react-popper
.Hover over the word "editing" and observe the error message.
What is the expected behavior?
The expected behavior is that this would show the Popper in the correct position without raising an error.
Packages versions