freenowtech / freenowtech/wave

Search throwing error when component gets unmounted

Open
#315 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
67
Forks
31
Avg merge
1d 8h
Merged PRs (30d)
4

Description

- `@freenow/wave` version: ^1.27.0

### Relevant code

```js
setSearchQuery(value)}
onClear={() => setSearchQuery('')}
/>
```

### Current Behaviour

When navigating away from a page with Search component, when running the application locally it throws the error shown in the video. In production it just silently puts this error into the console, without breaking anything.

### What was expected to happen?

No error thrown

### Reproduction

In my case when switching away from a page that has the Search component, the click outside event handler gets triggered, but the ref seems to already be gone from unmounting the parent component.
https://user-images.githubusercontent.com/9133431/226910666-973d4b7e-a69c-4d16-9450-7a18a93e8548.mov

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.