diff --git a/esm-samples/jsapi-custom-ui/README.md b/esm-samples/jsapi-custom-ui/README.md index 2cbad204f..f0c5a54ba 100644 --- a/esm-samples/jsapi-custom-ui/README.md +++ b/esm-samples/jsapi-custom-ui/README.md @@ -1,6 +1,8 @@ # Custom UI component with React and Vite -This repo demonstrates creating a custom UI component using [@arcgis/core](https://www.npmjs.com/package/@arcgis/core) ES modules with [React](https://react.dev/learn) and [Vite](https://vitejs.dev/guide/#community-templates). The component is created in React and then added to the Map as a DOM element using [View UI](https://developers.arcgis.com/javascript/latest/view-ui/). This approach loosely couples the component with the functionality in the ArcGIS Maps SDK for JavaScript. It provides seamless integration with your preferred component library, and gives you full control over the user experience and component-life cycle so that it fits your unique requirements. +This repo demonstrates creating a custom UI component using [@arcgis/core](https://www.npmjs.com/package/@arcgis/core) ES modules with [React](https://react.dev/learn) and [Vite](https://vitejs.dev/guide/#community-templates). You can also use any other major JavaScript framework. For more information about building custom UI with the ArcGIS JS SDK, see the [Custom UI basics](https://developers.arcgis.com/javascript/latest/custom-ui/) guide topic. + +The component in this sample is created in [JSX](https://react.dev/learn/writing-markup-with-jsx) and then added to the Map as a DOM element using the ArcGIS JS SDK's [View UI](https://developers.arcgis.com/javascript/latest/view-ui/) interface. This approach loosely couples the component with the functionality in the ArcGIS Maps SDK for JavaScript. It provides seamless integration with your preferred component library, and gives you full control over the user experience and component-life cycle so that it fits your unique requirements. ## Get Started diff --git a/esm-samples/jsapi-custom-ui/src/App.jsx b/esm-samples/jsapi-custom-ui/src/App.jsx index ad8127c00..6a37bba9d 100644 --- a/esm-samples/jsapi-custom-ui/src/App.jsx +++ b/esm-samples/jsapi-custom-ui/src/App.jsx @@ -3,14 +3,14 @@ import Bookmarks from '@arcgis/core/widgets/Bookmarks.js'; import Expand from '@arcgis/core/widgets/Expand.js'; import MapView from "@arcgis/core/views/MapView.js"; import WebMap from "@arcgis/core/WebMap.js"; -import CenterWidget from "./CenterWidget.jsx"; +import CenterComponent from "./CenterComponent.jsx"; import "./App.css"; function App() { const [viewState, setViewState] = useState(null); - const centerWidgetID = useRef("center-widget"); + const centerComponentID = useRef("center-component"); const mapDiv = useRef(null); useEffect(() => { @@ -39,8 +39,8 @@ function App() { // Add the Expand and BookMarks widgets to the top-right corner of the view view.ui.add(bkExpand, "top-right"); - // Add Center widget to the bottom-right corner of the view - view.ui.add(document.getElementById(centerWidgetID.current), "bottom-right"); + // Add Center component to the bottom-right corner of the view + view.ui.add(document.getElementById(centerComponentID.current), "bottom-right"); webmap.when(() => { setViewState({view}); @@ -48,7 +48,7 @@ function App() { } }, [mapDiv]); - return