Using a localStorage value as a useEffect dependency – Javascript
How can I use localstorage value of benchmarkActiveTab in the dependency array? The value is changing in the localstorage but the useEffect isn't running when the value changes const [activeTab, setActiveTab] = useState( localStorage.getItem("benchmarkActiveTab") || 0 ) useEffect(() => {…