How to stop react re-rendering component, if part of the state changes?
问题 Is there a way to stop react re-rendering if only part of state changes? The problem is that every time I hover on a marker a popup is opened or closed and it causes all the markers to re-render even though mystate is not changing only activePlace state is changing. console.log(myState); is running every time I hover in and out of the marker. I tried to use useMemo hook but couldn't figure out how to use it. Any help? Here is my code: import React, { useEffect, useState } from 'react'; import