I use react@18.3.1, react-resize-detector@12.0.2 and react-router-dom@6.10.0.
But sometimes, useResizeDetector behaves like this when the route changes.
Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.
My code is below.
const chartElemRef = useRef<HTMLDivElement>();
useResizeDetector({
handleWidth: true,
handleHeight: false,
targetRef: chartElemRef,
});
I use react@18.3.1, react-resize-detector@12.0.2 and react-router-dom@6.10.0.
But sometimes, useResizeDetector behaves like this when the route changes.
My code is below.