Make a Search Bar with React (with API Calls) | Beginners Tutorial
Data use API from https://jsonplaceholder.typicode.com/
onFocus
,onChange
,onClick
userEffect
,useCallback
,useState
,useRef
RegExp
,split
,replace
SearchBar.js
: for search inputSearchList.js
: for show listUserInfo.js
: for user information display
This small project can apply to React component directly, I've been done search filter in Vanilla Javascript with node.js before. Thus, I'm more familiar to deal with search methods for input with the particular behavior, like keydown
, keyup
, keypress
, blur
, focus
...etc. And make the codes completed with search filter and make highlight for keywords searching.