Skip to content

Asynchronously warning #262

@kkh975

Description

@kkh975

I use [email protected], [email protected] and [email protected].
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,
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions