bloomreach / spa-sdk

Apache License 2.0
15 stars 16 forks source link

Importing and Instantiating MenuItemImpl #35

Open linkhat29 opened 2 months ago

linkhat29 commented 2 months ago

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!