GMap onOverlayDragEnd event callback has access to outdated react states #2714
Labels
Type: Bug
Issue contains a defect related to a specific component.
Milestone
I'm submitting a
Codesandbox Case (Bug Reports)
https://codesandbox.io/s/primereact-test-forked-htby5q?file=/src/index.js
(Open the console and set filtering to "info")
Current behavior
When getting react states values inside the callback of the event onOverlayDragEnd, these values are outdated if the states have been modified AFTER the initialization of the
<GMap>
component. (the setters are working correctly, just the getters are broken)Expected behavior
React states values are up to date.
Minimal reproduction of the problem with instructions
<GMap>
component and define a callback for the eventonOverlayDragEnd
onOverlayDragEnd
and log the value of the state (mystate) inside the callback of the eventPlease tell us about your environment:
macOS Big Sur Version 11.6.2, VS Code, NPM
React version:
17.0.2
PrimeReact version:
7.2.1
Browser:
all
Language:
JSX
The text was updated successfully, but these errors were encountered: