Open gribnoysup opened 8 years ago
+1
It would be smarter to use CONSTANTS like
const MARKER_LAYOUT = "MarkerLayout";
switch() {
case MARKER_LAYOUT:
...
}
@dropfen constants with strings still will not help when file is minified because component displayName
is not provided for MarkerLayout
and BallonLayout
. So there are two options (maybe more, I can come up with only two now):
displayName
for MarkerLayout
and BallonLayout
componentscomponent.type
, not component.type.name
(this is what I am proposing in #21)my point is to use constants instead of all strings ( e.g dislayName: MARKER_LAYOUT
etc. )
Am 13.09.16 um 15:54 schrieb Sergey:
@dropfen https://github.com/dropfen constants with strings still will not help when file is minified because component |displayName| is not provided for |MarkerLayout| and |BallonLayout|. So there are two options (maybe more, I can come up with only two now):
- provide |displayName| for |MarkerLayout| and |BallonLayout| components
- compare |component.type|, not |component.type.name| (this is what I am proposing in #21 https://github.com/effrenus/yandex-map-react/pull/21)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/effrenus/yandex-map-react/issues/20#issuecomment-246688733, or mute the thread https://github.com/notifications/unsubscribe-auth/ACKYhzluog7uMQIiNGD51CuapNWL9Tlyks5qpqsogaJpZM4JZ1wQ.
When module is minified, this comparison doesn't work because components name is minified as well
I created a PR with possible solution #21