Answer the question
In order to leave comments, you need to log in
Who can explain how the component is implemented?
Good afternoon! Please explain how the Polyline component is implemented in this case .
Especially, it does not reach what these constants do (and what they are for).
How are they passed through the key?import {MAP, POLYLINE} from "../constants"
polyline.setMap (this.context [MAP])
this.state = {
[POLYLINE]: polyline,
}
Answer the question
In order to leave comments, you need to log in
import {MAP, POLYLINE} from "../constants"
The same as:
import * as constants from "../constants"
constants.MAP // {MAP}
constants.POLYLINE // {POLYLINE}
POLYLINE = "string";
state = {[POLYLINE]: polyline} // state = {string: polyline}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question