storefront-foundation / react-storefront

React Storefront - PWA for eCommerce. 100% offline, platform agnostic, headless, Magento 2 supported. Always Open Source, Apache-2.0 license. Join us as contributor (contributors@reactstorefront.io).
https://www.reactstorefront.io
Other
796 stars 190 forks source link

Custom submit button component for SearchField #225

Open ScyDev opened 2 years ago

ScyDev commented 2 years ago

In the code of SearchField.js I see this:

  /**
   * The component to use for the submit button.
   */
  SubmitButtonComponent: _propTypes["default"].elementType,

Does this mean we can pass our own custom component to be used for the submit button?

I tried this, but didn't work:

          <SearchHeader>
            <SearchField onChange={value => updateSearchTerm(value)} value={query} SubmitButtonComponent={CustomSearchButton} >
          </SearchHeader>