I have succesfully implemented Polylinedecorators, however I am not able to easily hide them based on a boolean statement in React Leaflet. 'Normal' polylines are displayed/hided based on a certain variable (for example the boolean 'certainBool'). I can not seem to find an easy way to easily add polyLineDecorators as a JSX component directly, without using the addToMap functionality. The problem with the addToMap functionality is that it is difficult to remove the elements added to the map in this way. Especially as my polylines (and polylinedecorators) are created in a (large) for loop. See the following code:
I have succesfully implemented Polylinedecorators, however I am not able to easily hide them based on a boolean statement in React Leaflet. 'Normal' polylines are displayed/hided based on a certain variable (for example the boolean 'certainBool'). I can not seem to find an easy way to easily add polyLineDecorators as a JSX component directly, without using the addToMap functionality. The problem with the addToMap functionality is that it is difficult to remove the elements added to the map in this way. Especially as my polylines (and polylinedecorators) are created in a (large) for loop. See the following code: