[Popper][Base] Fix Tooltip Anchor Element Setter
- [x] I have followed (at least) the PR section of the contributing guide.
Problem
When props.anchorEl is a function, it sometimes gets called with one argument when it expects no arguments (see codesandbox example).
Cause
This is happening because the state setter setTooltipAnchorEl(anchorEl) (recently added in #34714) calls a function anchorEl as if it were in the form of setTooltipAnchorEl((prev) => next).
Solution
We should call resolveAnchorEl on anchorEl before setting tooltipAnchorEl.
| Messages | |
|---|---|
| :book: | Netlify deploy preview: https://deploy-preview-35469--material-ui.netlify.app/ |
Generated by :no_entry_sign: dangerJS against c7ab9d2acda0996ed4e53478bec6748950291256
@mnajdova @michaldudak this is ready for review when you get a chance! Thanks!
LGTM @michaldudak Can you take a final look?
Looks good! I do have one remark about naming, but apart from that it's good to go.