question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

searchMatches are never updated

See original GitHub issue

I’m copy the example from here and can’t get the search focus/highlight working.

I debug the code and see that getDerivedStateFromProps is called a first time ( after pass the searchQuery={text} ) and it does .search() and return the searchMatches, but it is called again and in this second time it just returns the instanceProps and the prevState that came in this second time has the searchMatches empty.

I have the same dependencies like the sandbox, react/react-dom 16.9.0-alpha-0 and I also try with the previous one 16.8.6 but can’t get it working.

I also literally copy the codesandbox.io code and put in in the main of my app, but it didn’t work.

I can’t reproduce or debug the state/error in https://codesandbox.io

If someone could give some idea or point me in some direction to understand this I will really appreciate it.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

8reactions
rhoffmann8commented, Jun 12, 2020

Out of curiosity, were you using this within a create-react-app running in development mode?

I also ran into this issue when using this library in an application bootstrapped via create-react-app, and I believe the double call to getDerivedStateFromProps is a symptom of StrictMode: https://github.com/facebook/react/issues/15074#issuecomment-471197572. After running a production build and serving the application, the issue disappeared.

0reactions
tianzhichcommented, Nov 4, 2022

I fixed it in this fork https://github.com/nosferatu500/react-sortable-tree/pull/32. For someone who wish to use this library you can use it instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update means I can't search for my matches? : r/Tinder - Reddit
I have an android and with this new update there's no search bar anymore for me to find people I've already matched with...
Read more >
How to Fix Can't Find Matches on Tinder - Saint
If you can't find any matches on Tinder, try updating the app to patch errors and other issues. See the steps below to...
Read more >
Google Now Tells You: There Aren't Any Great Matches for ...
In an unusual update to search, Google is letting users know when the results they're seeing are lower-than-average quality.
Read more >
Problems with Matches - Tinder FAQ
Problems with Matches. Accidentally unmatched someone. One or a few matches disappeared. All of my matches disappeared. No new matches.
Read more >
Outlook Search not showing recent emails after Windows ...
Note: Some users did not see immediate resolution after installing the update. If you do not see the issue resolved try rebuilding the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found