Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search throwing error when component gets unmounted #315

Open
phllipo opened this issue Mar 22, 2023 · 1 comment
Open

Search throwing error when component gets unmounted #315

phllipo opened this issue Mar 22, 2023 · 1 comment

Comments

@phllipo
Copy link
Contributor

phllipo commented Mar 22, 2023

  • @freenow/wave version: ^1.27.0

Relevant code

<Search
      width="400px"
      placeholder={placeholder}
      value={searchQuery}
      onInputChange={(value) => 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

@lloydaf
Copy link
Contributor

lloydaf commented Oct 24, 2023

Hi @phllipo would it be possible to create a codesandbox or point me towards any internal links where this issue can be reproduced?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants