Select to view content in your preferred language

Experience Builder widgets as Class or Function?

1110
4
01-19-2024 12:25 PM
Labels (2)
DHighness
Occasional Contributor

Hey,

I've been developing mapping web sites since ArcIMS but I'm brand new to Experience Builder and am beginning to learn the custom widget workflow. I'm also new to ES6 and React, etc. I see that there are two methods for creating the widgets; as a class and as a function. In the documentation they have the attributes of both methods but I don't see any recommendations for which should be used. The only comment I see is that most of the samples use the class method.

What are the pluses and minuses of each method (class and function)?

Which is simplest to learn?

Which one should I be using if I'm starting out?

Which is less likely to be deprecated on 3 years?

It would be nice to get started on the right foot.

Thanks,

Dave

 

0 Kudos
4 Replies
JeffreyThompson2
MVP Frequent Contributor

Functional React is Modern React. Use functions.

Here is my intro to React.

GIS Developer
City of Arlington, Texas
DHighness
Occasional Contributor

Great! Thanks!

0 Kudos
lmotta_ibama
Occasional Contributor

@DHighness ,

I'm new to developing widgets for ExpB.

My suggestion is to start studying only React, so you understand what React is and then when you read the plugins' code, you'll understand how the plugin's architecture works and how to use the ArcGIS API (arcgis sdk javascript).

When I started studying React, I kept jumping from page to page on the web looking at codes and explanations about React. My learning was scattered, I couldn't understand how to do something really in React.

I decided to take a React course on Udemy (React - The Complete Guide 2024) in December 2023.

I didn't even need to finish it because I had already learned enough to start developing the widgets for ExpB.

I'm developing my first widget, and I've started exploring the ArcGIS API.

Good luck on your journey

 

 

 

DHighness
Occasional Contributor

Thanks. I've been doing some React tutorials and have been getting the hang of it. The Udemy Academy class is a great idea though. I'll look into that.

0 Kudos