tomwayson / esri-loader-hooks

Custom React hooks for using the ArcGIS API for JavaScript with esri-loader.

Home Page:https://esri-loader-hooks.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't pass JSON object to useWebMap

gavinr opened this issue · comments

In order to specify a portalUrl, I want to pass a JSON object to useWebMap like this:

const [ref, view] = useWebMap({
    portalItem: {
      id: '123abc',
      portal: {
        url: 'https://my.portal.url'
      }
    },
  }, { .... });

As it seems like I can do here:

: MapClass.fromJSON(item);

But the code never gets into loadItem() since I'm passing in an object (not a string), isItem is always false here, and always goes into loadMap (where I want it instead to go into loadItem)