'React Filtering based on user input -State, setState, useState, Hooks

I have a fun project that is filter data using .filter .map etc etc - At the moment I have a select -> option that changes the state of the data presented to the user but I also want to filter based an onChange event but have issues with the whole filter part

https://j121b.csb.app/ is the code sandbox and this is the issue:

Type Error - data.instName.contains is not a function

Could someone look over code and point me in the right direction please? Thank you and happy Friday :)



Solution 1:[1]

Use includes instead of contains.

Solution 2:[2]

Actually I sorted it - https://j121b.csb.app/ Look at the different states!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Duveral
Solution 2 daveCodesCode