import { useEffect, useRef } from 'react' import { useDispatch } from 'react-redux' import { setQuery } from './app/searchSlice' import { setShowName } from './app/displaySlice' import { IconList } from './IconList' import './App.css' function App() { const inputSearch = useRef() const checkShowName = useRef() const dispatch = useDispatch() function queryOnChange () { dispatch(setQuery(inputSearch.current.value)) } function showNameOnChange () { dispatch(setShowName(checkShowName.current.checked)) } useEffect(() => { inputSearch.current.focus() }) return ( <>
) } export default App