{"by":"hadat","descendants":7,"id":44507084,"kids":[44507954,44507587,44508453],"score":32,"text":"Hey Hacker News,<p>I&#x27;m a long-time lurker and wanted to share a project I just finished building.<p>Like many React Native developers, I needed to add marker clustering to a map in my app. The most popular library for this, react-native-maps-clustering, was fantastic in its day but has become outdated and no longer works with modern versions of Expo, React Native, and their dependencies.<p>After hitting a wall of compatibility issues, I decided to take on the challenge of rewriting it from the ground up, focusing on a modern toolchain and a better developer experience.<p>The journey was a lot more challenging than I anticipated. It turned into a deep dive into solving dependency hell with different versions of @types&#x2F;react, wrestling with build tool configurations for pnpm, bob, and ESLint, and ensuring everything was strictly typed with TypeScript. It felt like a classic case of yak shaving, but I was determined to create a solution that &quot;just works&quot; for developers today.<p>The result is RN Super Cluster, a performant, fully-typed, and easy-to-use clustering library for react-native-maps.<p>What it does:\nIt provides a &lt;ClusteredMapView &#x2F;&gt; component that you can use as a drop-in replacement for the standard &lt;MapView &#x2F;&gt;. Any &lt;Marker &#x2F;&gt; components you place inside will be automatically clustered.<p>Key Features:<p><pre><code>    Modern &amp; Maintained: Built with a modern toolchain and designed to be actively maintained.\n\n    Fully-Typed: Written entirely in TypeScript to prevent common errors and improve autocompletion.\n\n    High-Performance: Uses supercluster under the hood for extremely fast geospatial clustering.\n\n    Spiderfier: At the maximum zoom level, overlapping markers automatically &quot;spiderfy&quot; (spread out on a spiral) so they can be individually tapped.\n\n    Customizable: You can provide your own custom components for rendering clusters, and callbacks for handling press events.\n</code></pre>\nThis was a passion project born out of necessity, and I hope it can save other React Native developers the headaches I went through.<p>I would love to get your feedback, and contributions are more than welcome!<p>GitHub: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;suwi-lanji&#x2F;rn-maps-clustering\">https:&#x2F;&#x2F;github.com&#x2F;suwi-lanji&#x2F;rn-maps-clustering</a>\nNPM: <a href=\"https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;rn-maps-clustering\" rel=\"nofollow\">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;rn-maps-clustering</a><p>Thanks for checking it out!","time":1752044864,"title":"Show HN: I rewrote an outdated React Native map clustering library","type":"story","url":"https://github.com/suwi-lanji/rn-maps-clustering"}