Using updateTriggers to change fill color in React #5596
Unanswered
kamrankhanwastaken
asked this question in
Q&A
Replies: 1 comment 6 replies
-
I was able to get this to work through a workaround by using the
The only problem is that on hovering over a particular index sometimes it will highlight the line layer and not the polygon layer. Is there a way to avoid that? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to update the fill color for a feature within a geojson feature collection object when someone hovers over a particular one on the map. I am using
updateTriggers
but unsure why this won't work:I am changing the state for
hoverInfo
insideonHover
and then using that to track changes togetFillColor
inupdateTriggers
. Lastly, in the function I check if theorder
attribute of the feature is the same as thehoverInfo.index
one. The logic makes sense to me but nothing is happening.Beta Was this translation helpful? Give feedback.
All reactions