seanmturley / natureddit

A simple Reddit client, featuring a landing page dedicated to nature with posts pulled from a curated list of subreddits.
0 stars 1 forks source link

Investigate "clear search" bug #133

Open seanmturley opened 1 year ago

seanmturley commented 1 year ago

Description

A rare bug occurs where the "clear search" button generates an error in React. I currently don't have the error message - I think it's something to do with not having subreddit data to render the SearchDropdown options in the searchDropdown.

Bug reproduction

Unclear how to reproduce the error.

Action

Keeping this open to collect more information when the bug reoccurs.

seanmturley commented 1 year ago

This just happened again. Here's the error:

SearchDropdown.js:52 Uncaught TypeError: Cannot read properties of undefined (reading 'map') at SearchDropdown (SearchDropdown.js:52:1)

So it seems like the data is being cleared, but the SearchDropdown is still there momentarily, which throws an error because it has nothing to map over.