Select to view content in your preferred language

React 19 & ExB

191
1
02-12-2026 09:10 AM
LefterisKoumis
Frequent Contributor

This page is titled "Use Map Components (React 19 + Web Components)" and it provides instructions to download the SDK to a new folder on your ExB development environment called "web-component-widgets/use-web-components-19". React JS 19 uses functional components. Under the "Contents" version it states:

LefterisKoumis_1-1770916166322.png

The issue I see is that at the SDK location it still uses class components. For example, the "add-layers" sample it states that it was updated to version 1.19 but the script suggests otherwise.

LefterisKoumis_0-1770916020532.png

 

render () {
    const style = css`
      form > div {
        display: flex;
        justify-content: space-between;
        input {
          width: 100%;
        }
        button {
          min-width: 100px;
        }
      }
    `
    return (
      <div className="widget-addLayers jimu-widget p-2" css={style}>
        {this.props.hasOwnProperty('useMapWidgetIds') &&
          this.props.useMapWidgetIds &&
          this.props.useMapWidgetIds.length === 1 && (
            <JimuMapViewComponent
              useMapWidgetId={this.props.useMapWidgetIds?.[0]}
              onActiveViewChange={(jmv: JimuMapView) => {
                this.setState({
                  jimuMapView: jmv
                })
              }}
            />
        )}

        <p>{defaultMessages.instructions}</p>

 

0 Kudos
1 Reply
JeffreyThompson2
MVP Frequent Contributor

Class based React components are an older style of React. They are no longer recommended and the documentation has been buried on the React documentation site, but they are still completely valid and functional and there are no plans to remove them from React.

The instructions state that you should copy the folder containing the example Widget you want to use to your-extensions/widgets. Some of the example Widgets require installing third-party packages using npm and will fail if those packages are not installed.

GIS Developer
City of Arlington, Texas
0 Kudos