The problem: You’re not well-versed in JSX or ES6 syntax (like arrow functions), but the only example you can find of a custom block that does what you want to do is written in this style.
The solution: Copy the code snippet (in complete statements) that you don’t understand, head over to the Try It Out page on the Babel website, and paste the code into the left-hand box. In the right-hand box you’ll receive the transpiled code in ES5 and React. To use the code snippet in your project, replace all instances of React
with wp.element
.