import React , { useCallback } from 'react' ; import { useApolloClient } from '@apollo/react-hooks' ; import { SearchBar } from 'components' ; const SearchBarContainer = ( ) => { const client = useApolloClient ( ) ; const updateQuery = useCallback ( ( searchQuery ) => { client . writeData ( { data : { searchQuery } } ) ; } , [ client ] ) ; return ( < SearchBar updateQuery = { updateQuery } / > ) ; } ; export default React . memo ( SearchBarContainer ) ;