AppmakerDeveloper

How to show Recent search

This is a simple example of how to show recent search in your app.

Steps to show recent search in default view:
  • Enable recent search plugin Search History from dashboard.
  • Place this block in the desired page to show the recent searches.
   {
     name: 'appmaker/recent-search-wrapper',
     attributes: {},
   },
Steps to show recent search in Custom view:
  • To customize the Recent Search item view, override the block appmaker/recent-search-item with your own view. you will receive recent search queries in props.
   {
    name: 'appmaker/recent-search-item',
    View: CustomRecentSearchItem,
   }

   const CustomRecentSearchItem = ({ attributes }) => {
        // Query will be available in 'attributes'
    return(<Text>{attributes.query}</Text>)
   }