Select to view content in your preferred language

ReactJS Typescript

621
6
10-23-2025 07:20 AM
vijaybadugu
Frequent Contributor

Is there any help online documentation for mapcomponents react js ? 

0 Kudos
6 Replies
DavidSolari
MVP Regular Contributor

If you're asking how to embed the new SDK components in a React component, the official docs go over how to render them and pass in data to their attributes. Once you hit a wall you can post about the specific component/attribute issue you're having and get focused help from there.

0 Kudos
vijaybadugu
Frequent Contributor

I created a separate component ActionBar.tsx , Which includes, Layers, Legend and basemap Gallerty 

      <CalcitePanel
        ref={(el) => { panelRefs.current['legend'] = el; }}
        heading="Legend"
        data-panel-id="legend"
     
        closed={activeWidget !== 'legend'}
        closable
        onCalcitePanelClose={handlePanelClose}
        style={{ height: '100%' }}
      >
        {mapRef && <ArcgisLegend legendStyle="classic" referenceElement={mapRef} />}  
 
I have passed Map reference object and View object, Nothing is working. I was getting No Legend.
0 Kudos
Justin_Greco
Frequent Contributor

I'm thinking it should be mapRef.current instead of just mapRef.

0 Kudos
vijaybadugu
Frequent Contributor

I tried everything with no luck

0 Kudos
Justin_Greco
Frequent Contributor

Can you post the entire code for your component? 

Since you are using React 19 and if this is a new app, I’d recommend not using the calcite-components-react wrapper.  

0 Kudos
ReneRubalcava
Esri Frequent Contributor

If you have a github repo, can take a look, but our samples don't use the react wrappers

https://github.com/Esri/jsapi-resources/tree/main/component-samples/map-and-charts-components-react

0 Kudos