Code:
import DrawControl from "react-mapbox-gl-draw";
export default function MapboxGLMap() {
let drawControl = null
return(
<DrawControl ref={DrawControl => {drawControl = DrawControl}}/>
)
}
I want to load data when the drawControl
not null. I check the document that may use callback ref.
So, how do I listen the drawControl
changes and load data?