woocommerce / woocommerce-admin

(Deprecated) This plugin has been merged to woocommerce/woocommerce
https://woocommerce.github.io/woocommerce-admin/#/
Other
361 stars 146 forks source link

Navigation items in the wc nav should register click handlers #5098

Closed joshuatf closed 3 years ago

joshuatf commented 3 years ago

Note: wait on decision for compositional structure in https://github.com/WordPress/gutenberg/pull/25057 before tackling this issue.

WooCommerce Admin should register its own click handlers or components for use in the wc nav project. Currently, clicking these links navigates to the page using a standard link without using the react router in WCA.

There's a filter for the menu items that can be used to modify the data: woocommerce_navigation_menu_items. It's probably easiest to pass the component used for linking directly to the menu items using the LinkComponent prop.

{
  id: 'menu-item',
  title: 'My menu item',
  LinkComponet: NavLink,
}
Screen Shot 2020-09-04 at 11 54 09 AM
psealock commented 3 years ago

Closing this because we went with a composible approach in Gutenberg.