Skip to content

[Bug]: With react new arch, allowOverlap is always true #3889

@scharron

Description

@scharron

Mapbox Implementation

Mapbox

Mapbox Version

10.19.4

React Native Version

0.79.4

Platform

iOS

@rnmapbox/maps version

10.1.39

Standalone component to reproduce

import { Camera, MapView, MarkerView } from '@rnmapbox/maps';
import React from 'react';
import { Text } from 'react-native';

const BugReportExample = () => {
  return (
    <MapView style={{ flex: 1 }}>
      <Camera centerCoordinate={[2.2943506, 48.8588443]} zoomLevel={12} />
      <MarkerView id="marker1" coordinate={[2.2943506, 48.8588443]} allowOverlap={false}>
        <Text style={{ backgroundColor: 'white' }}>This is a marker</Text>
      </MarkerView>
      <MarkerView id="marker2" coordinate={[2.2743506, 48.8788443]} allowOverlap={false}>
        <Text style={{ backgroundColor: 'white' }}>This is another marker</Text>
      </MarkerView>
    </MapView>
  );
};

Observed behavior and steps to reproduce

Both MarkerViews are displayed when they collide

Expected behavior

Only one of the MarkerViews should appear

Notes / preliminary analysis

This bug appears using the new react architecture.
This is because of the id allowOverlap = RNMBXConvertFollyDynamicToId(newProps.allowOverlap); conversions that returns a pointer that is always true instead of the value of the pointed object according to #3730

Additional links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions