I'm currently working on a react project with @bloomreach/react-sdk": "14.5.0" and "@bloomreach/spa-sdk": "14.6.0". I'm in the process of updating the code to work with Delivery API 1.0.
I'm trying to instantiate a new MenuItemImpl object to push onto a Menu object's items[] but I'm having some issues doing so.
When I try to import LinkFactory, MenuItemFactory, MenuItemImpl, MenuItemModel from the SPA SDK I get the following message
Module '"@bloomreach/spa-sdk"' has no exported member '
I'm currently on @bloomreach/react-sdk": "14.5.0" so I know it's really behind but I also can see the MenuItem interface coming from the package and it has the new getter methods for Delivery API 1.0:
interface MenuItem {
/**
@return The child items.
*/
getChildren(): MenuItem[];
/**
@return The menu item depth level.
*/
getDepth(): number;
/**
@return The menu item link.
*/
getLink(): Link | undefined;
/**
@return The menu item name.
*/
getName(): string;
/**
@return The menu item parameters.
*/
getParameters(): object;
/**
@return The menu item url.
*/
getUrl(): string | undefined;
/**
@return Whether the menu item is expanded.
*/
isExpanded(): boolean;
/**
@return Whether the menu item is repository based.
*/
isRepositoryBased(): boolean;
/**
@return Whether the menu item is selected.
*/
isSelected(): boolean;
}
Is there a reason the other members aren't exported?
Also, when I look at the React example code I see that the parameters for MenuItemImpl include a menuItemModel, LinkFactory, and MenuItemFactory. However I don't see any examples on how to instantiate LinkFactory and MenuItemFactory. I just see mocking in the spec files. Is there any example on that?
Hello,
I'm currently working on a react project with @bloomreach/react-sdk": "14.5.0" and "@bloomreach/spa-sdk": "14.6.0". I'm in the process of updating the code to work with Delivery API 1.0.
I'm trying to instantiate a new MenuItemImpl object to push onto a Menu object's items[] but I'm having some issues doing so.
When I try to import LinkFactory, MenuItemFactory, MenuItemImpl, MenuItemModel from the SPA SDK I get the following message
Module '"@bloomreach/spa-sdk"' has no exported member '
I'm currently on @bloomreach/react-sdk": "14.5.0" so I know it's really behind but I also can see the MenuItem interface coming from the package and it has the new getter methods for Delivery API 1.0:
interface MenuItem { /**
Is there a reason the other members aren't exported?
Also, when I look at the React example code I see that the parameters for MenuItemImpl include a menuItemModel, LinkFactory, and MenuItemFactory. However I don't see any examples on how to instantiate LinkFactory and MenuItemFactory. I just see mocking in the spec files. Is there any example on that?
Thanks!