简体   繁体   中英

What does `class Popup extends DivOverlay<LeafletElement, Props>` syntax mean in javascript?

I am working a lot with react-leaflet, and I see that part of the way it is constructed is using syntax like this:

class Popup extends DivOverlay<LeafletElement, Props>

and

export default withLeaflet<Props, Popup>(Popup)

I found some answers that were more geared towards Java. What does this mean in javascript, and specifically in the context of React and React higher order components?

This is statically typing components using TypeScript, which you can find a guide to here .

It essentially shapes what the data looks like for props and state for the component in question. In your case, either Popup or withLeaflet as both are components.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM