<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Alex</title>
    <description>The latest articles on Forem by Alex (@pioner92).</description>
    <link>https://forem.com/pioner92</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F593389%2F72682f79-9a1f-4b73-9377-64eedb938b77.jpeg</url>
      <title>Forem: Alex</title>
      <link>https://forem.com/pioner92</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/pioner92"/>
    <language>en</language>
    <item>
      <title>Control a Farming Drone with C++ — Play It in Your Browser (Cropbot)</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Tue, 03 Mar 2026 09:53:10 +0000</pubDate>
      <link>https://forem.com/pioner92/control-a-farming-drone-with-c-play-it-in-your-browser-cropbot-5f79</link>
      <guid>https://forem.com/pioner92/control-a-farming-drone-with-c-play-it-in-your-browser-cropbot-5f79</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flej3wu5o98ts559kscq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flej3wu5o98ts559kscq8.png" alt="Preview" width="800" height="806"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What if a farming game didn’t let you click anything?&lt;/p&gt;

&lt;p&gt;What if the only way to control the world… was to write C++?&lt;/p&gt;

&lt;p&gt;I built exactly that.&lt;/p&gt;

&lt;p&gt;A browser-based game where you control a farming drone entirely through C++ code — compiled to WebAssembly and executed live in the game.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Play it here:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://cropbot.fly.dev/" rel="noopener noreferrer"&gt;https://cropbot.fly.dev/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No install.&lt;br&gt;&lt;br&gt;
No setup.&lt;br&gt;&lt;br&gt;
Just open and start coding.&lt;/p&gt;




&lt;h2&gt;
  
  
  You Don’t Play. You Program.
&lt;/h2&gt;

&lt;p&gt;The world is a grid.&lt;/p&gt;

&lt;p&gt;Each cell can be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Empty
&lt;/li&gt;
&lt;li&gt;Tilled
&lt;/li&gt;
&lt;li&gt;Planted
&lt;/li&gt;
&lt;li&gt;Growing
&lt;/li&gt;
&lt;li&gt;Ready to harvest
&lt;/li&gt;
&lt;li&gt;Base station
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The drone can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Move across the grid
&lt;/li&gt;
&lt;li&gt;Till soil
&lt;/li&gt;
&lt;li&gt;Plant different crops
&lt;/li&gt;
&lt;li&gt;Water them
&lt;/li&gt;
&lt;li&gt;Harvest them
&lt;/li&gt;
&lt;li&gt;Buy seeds
&lt;/li&gt;
&lt;li&gt;Manage energy and water
&lt;/li&gt;
&lt;li&gt;Earn gold
&lt;/li&gt;
&lt;li&gt;Increase score
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But here’s the key difference:&lt;/p&gt;

&lt;p&gt;You never click to move.&lt;br&gt;&lt;br&gt;
You never press a harvest button.  &lt;/p&gt;

&lt;p&gt;You write the logic — and the drone executes it.&lt;/p&gt;




&lt;h2&gt;
  
  
  It Quickly Stops Being “Farming”
&lt;/h2&gt;

&lt;p&gt;At first, it feels simple:&lt;/p&gt;

&lt;p&gt;If a cell is empty — plant.&lt;br&gt;&lt;br&gt;
If it’s ready — harvest.&lt;/p&gt;

&lt;p&gt;But then systems start stacking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Water tank capacity
&lt;/li&gt;
&lt;li&gt;Energy limits
&lt;/li&gt;
&lt;li&gt;Seeds cost gold
&lt;/li&gt;
&lt;li&gt;Crops grow over time
&lt;/li&gt;
&lt;li&gt;Grid traversal must be efficient
&lt;/li&gt;
&lt;li&gt;Score depends on smart decisions
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suddenly, it’s not a farming game.&lt;/p&gt;

&lt;p&gt;It’s an optimization problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  It’s About Designing Behavior
&lt;/h2&gt;

&lt;p&gt;You don’t react.&lt;/p&gt;

&lt;p&gt;You design.&lt;/p&gt;

&lt;p&gt;You write loops.&lt;br&gt;
You define conditions.&lt;br&gt;
You structure traversal.&lt;br&gt;
You manage resources.&lt;/p&gt;

&lt;p&gt;If your logic is inefficient:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You waste ticks
&lt;/li&gt;
&lt;li&gt;You waste energy
&lt;/li&gt;
&lt;li&gt;You miss harvest windows
&lt;/li&gt;
&lt;li&gt;Your score drops
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The game becomes about algorithm design.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why C++?
&lt;/h2&gt;

&lt;p&gt;Most programming games use Python.&lt;/p&gt;

&lt;p&gt;I deliberately chose C++.&lt;/p&gt;

&lt;p&gt;Because C++ forces clarity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strong typing
&lt;/li&gt;
&lt;li&gt;Explicit control flow
&lt;/li&gt;
&lt;li&gt;Deterministic execution
&lt;/li&gt;
&lt;li&gt;Clear system boundaries
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It feels less like scripting.&lt;/p&gt;

&lt;p&gt;More like engineering a machine.&lt;/p&gt;

&lt;p&gt;And your drone is that machine.&lt;/p&gt;




&lt;h2&gt;
  
  
  Under the Hood
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Your C++ code is compiled to WebAssembly
&lt;/li&gt;
&lt;li&gt;A restricted drone API is injected
&lt;/li&gt;
&lt;li&gt;The simulation runs in a sandbox
&lt;/li&gt;
&lt;li&gt;Grid size is provided dynamically
&lt;/li&gt;
&lt;li&gt;Only safe functions are exposed
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your code becomes the AI brain.&lt;br&gt;&lt;br&gt;
The game becomes the environment.&lt;/p&gt;

&lt;p&gt;Clean separation.&lt;br&gt;&lt;br&gt;
Deterministic simulation.&lt;br&gt;&lt;br&gt;
Pure logic.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where This Can Go
&lt;/h2&gt;

&lt;p&gt;This is just the first version.&lt;/p&gt;

&lt;p&gt;But the concept has serious room to grow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Competitive bot leaderboards
&lt;/li&gt;
&lt;li&gt;Optimization tournaments
&lt;/li&gt;
&lt;li&gt;Different maps with obstacles
&lt;/li&gt;
&lt;li&gt;Energy-constrained challenges
&lt;/li&gt;
&lt;li&gt;Multi-drone simulations
&lt;/li&gt;
&lt;li&gt;Profit-maximizing strategies
&lt;/li&gt;
&lt;li&gt;Time-based scoring competitions
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It could evolve into a full C++ automation strategy game.&lt;/p&gt;

&lt;p&gt;Or even a competitive AI arena in the browser.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;If you enjoy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automation
&lt;/li&gt;
&lt;li&gt;Systems thinking
&lt;/li&gt;
&lt;li&gt;Algorithm design
&lt;/li&gt;
&lt;li&gt;Programming-driven gameplay
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You might like this.&lt;/p&gt;

&lt;p&gt;Open it.&lt;br&gt;&lt;br&gt;
Write some C++.&lt;br&gt;&lt;br&gt;
Watch your drone think.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://cropbot.fly.dev/" rel="noopener noreferrer"&gt;https://cropbot.fly.dev/&lt;/a&gt;&lt;br&gt;
repo: &lt;a href="https://github.com/pioner92/cropbot" rel="noopener noreferrer"&gt;https://github.com/pioner92/cropbot&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This started as a small experiment.&lt;/p&gt;

&lt;p&gt;But “control a drone with C++” feels like a concept with real potential.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>programming</category>
      <category>gamechallenge</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>Building the Fastest Base64 Library for React Native - Introducing react-native-turbo-base64</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Mon, 09 Feb 2026 09:28:49 +0000</pubDate>
      <link>https://forem.com/pioner92/building-the-fastest-base64-library-for-react-native-introducing-react-native-turbo-base64-50n1</link>
      <guid>https://forem.com/pioner92/building-the-fastest-base64-library-for-react-native-introducing-react-native-turbo-base64-50n1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F72615uryocy3ar2owm93.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F72615uryocy3ar2owm93.png" alt=" " width="800" height="771"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you work with images, camera frames, blobs or crypto in React Native, you are probably using Base64 more than you think.&lt;/p&gt;

&lt;p&gt;I discovered this the hard way while profiling a production React Native app. Base64 encoding and decoding kept showing up in hot paths and consuming noticeable CPU time. At first it felt surprising. Then it became obvious - Base64 sits right in the middle of many media and binary workflows.&lt;/p&gt;

&lt;p&gt;That is when I decided to dig deeper.&lt;/p&gt;

&lt;p&gt;After analyzing existing solutions, especially react-native-quick-base64, I realized there was still a lot of performance left on the table. Most apps do not feel it immediately, but when Base64 operations happen frequently or on large buffers, the cost becomes real.&lt;/p&gt;

&lt;p&gt;So I built a new library from scratch focused purely on performance.&lt;/p&gt;

&lt;p&gt;Meet react-native-turbo-base64 🚀&lt;/p&gt;

&lt;p&gt;Why another Base64 library&lt;br&gt;&lt;br&gt;
This was not about rewriting something that already works. The goal was simple - push performance as far as possible for React Native workloads.&lt;/p&gt;

&lt;p&gt;The library is implemented in C++ and exposed through JSI, which means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No bridge overhead
&lt;/li&gt;
&lt;li&gt;No async hops between JS and native
&lt;/li&gt;
&lt;li&gt;Direct work with ArrayBuffers
&lt;/li&gt;
&lt;li&gt;Much less copying and allocation
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words, the data stays where it should be and moves as little as possible.&lt;/p&gt;

&lt;p&gt;What makes it fast&lt;br&gt;&lt;br&gt;
The implementation focuses on low level optimizations that matter in real mobile workloads:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zero unnecessary memory copies
&lt;/li&gt;
&lt;li&gt;Cache-friendly lookup tables
&lt;/li&gt;
&lt;li&gt;Tight loops optimized for modern CPUs
&lt;/li&gt;
&lt;li&gt;Designed specifically for Hermes and React Native
&lt;/li&gt;
&lt;li&gt;Works directly with binary buffers instead of strings whenever possible
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These changes may sound small individually, but together they create a big difference.&lt;/p&gt;

&lt;p&gt;Benchmark results&lt;br&gt;&lt;br&gt;
Across multiple tests, react-native-turbo-base64 consistently achieved multiple times faster encoding and decoding compared to react-native-quick-base64.&lt;/p&gt;

&lt;p&gt;This becomes especially noticeable when working with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Camera frames
&lt;/li&gt;
&lt;li&gt;Image processing
&lt;/li&gt;
&lt;li&gt;Large files and uploads
&lt;/li&gt;
&lt;li&gt;Crypto and hashing pipelines
&lt;/li&gt;
&lt;li&gt;Heavy ArrayBuffer usage
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even small improvements in hot paths can translate into real battery and performance gains on mobile devices.&lt;/p&gt;

&lt;p&gt;Drop-in replacement&lt;br&gt;&lt;br&gt;
If you are already using react-native-quick-base64, migrating should be straightforward. The API was designed to be familiar so you can switch with minimal effort.&lt;/p&gt;

&lt;p&gt;Open source and feedback welcome&lt;br&gt;&lt;br&gt;
This project was born from real profiling and real bottlenecks. I would love feedback from developers who are pushing React Native performance or working with heavy media pipelines.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/pioner92/react-native-turbo-base64" rel="noopener noreferrer"&gt;react-native-turbo-base64&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If Base64 ever showed up in your profiler, this library is for you 🙂&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>base64</category>
      <category>react</category>
      <category>jsi</category>
    </item>
    <item>
      <title>I built a 500x faster ULID generator for React Native (JSI + C++)</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Fri, 30 Jan 2026 09:29:07 +0000</pubDate>
      <link>https://forem.com/pioner92/i-built-a-500x-faster-ulid-generator-for-react-native-jsi-c-4o92</link>
      <guid>https://forem.com/pioner92/i-built-a-500x-faster-ulid-generator-for-react-native-jsi-c-4o92</guid>
      <description>&lt;p&gt;If you build React Native apps long enough, you eventually hit a point where “small” things start showing up in performance profiles.&lt;/p&gt;

&lt;p&gt;For me, one of those things was &lt;strong&gt;ID generation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Chat messages, offline queues, analytics events, local DB rows, sync logs - you generate IDs everywhere. And once you start generating IDs &lt;strong&gt;a lot&lt;/strong&gt; (sometimes thousands in one run), a pure JavaScript solution becomes surprisingly expensive.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;react-native-ulid-jsi&lt;/strong&gt;: an &lt;strong&gt;ultra-fast ULID generator for React Native&lt;/strong&gt; implemented in &lt;strong&gt;C++ via JSI&lt;/strong&gt;, with &lt;strong&gt;monotonic ordering&lt;/strong&gt;, &lt;strong&gt;thread-local state&lt;/strong&gt;, and &lt;strong&gt;platform-native secure randomness&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Result: &lt;strong&gt;~500x faster&lt;/strong&gt; than a popular JS ULID implementation in my benchmark.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why ULID (and not UUID)
&lt;/h2&gt;

&lt;p&gt;ULID stands for &lt;strong&gt;Universally Unique Lexicographically Sortable Identifier&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A ULID is a 26-character string like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;01ARZ3NDEKTSV4RRFFQ69G5FAV&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It’s composed of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;48-bit timestamp&lt;/strong&gt; (milliseconds since epoch)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;80-bit randomness&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That gives you two huge benefits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Lexicographic sort order by creation time&lt;/strong&gt; (great for DB indexes)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strong uniqueness&lt;/strong&gt; without coordination&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In practice, ULIDs are excellent for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;database primary keys (B-tree friendly)&lt;/li&gt;
&lt;li&gt;event sourcing&lt;/li&gt;
&lt;li&gt;logging and telemetry&lt;/li&gt;
&lt;li&gt;distributed systems&lt;/li&gt;
&lt;li&gt;file names / resource IDs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;UUIDs are fine for uniqueness, but they don’t preserve time ordering and usually fragment indexes harder.&lt;/p&gt;




&lt;h2&gt;
  
  
  The React Native problem: JavaScript ID generation is not “free”
&lt;/h2&gt;

&lt;p&gt;Even if a JS ULID library is well-written, in React Native it still has typical JS costs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;allocations and GC pressure&lt;/li&gt;
&lt;li&gt;repeated encoding work (Base32)&lt;/li&gt;
&lt;li&gt;randomness generation overhead&lt;/li&gt;
&lt;li&gt;runtime overhead in hot loops&lt;/li&gt;
&lt;li&gt;lots of “tiny” work that becomes big at scale&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And in mobile apps, you often care about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;battery&lt;/li&gt;
&lt;li&gt;smoothness on mid-tier devices&lt;/li&gt;
&lt;li&gt;cold start / background tasks&lt;/li&gt;
&lt;li&gt;performance under load&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted an ID generator that behaves like a native primitive:&lt;br&gt;
&lt;strong&gt;fast, predictable, and cheap&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  The solution: ULID in C++ via JSI (zero bridge overhead)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;react-native-ulid-jsi&lt;/strong&gt; is implemented in &lt;strong&gt;C++&lt;/strong&gt; and exposed to JavaScript via &lt;strong&gt;JSI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;no React Native Bridge serialization&lt;/li&gt;
&lt;li&gt;no JSON conversion&lt;/li&gt;
&lt;li&gt;direct function call from JS into native&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It supports both:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;New Architecture (Fabric + TurboModules)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Old Architecture&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same API. Same performance benefits.&lt;/p&gt;


&lt;h2&gt;
  
  
  Benchmark: 1000 ULIDs in 0.17ms (iPhone 16 Pro)
&lt;/h2&gt;

&lt;p&gt;I compared it against the official &lt;strong&gt;ulid/javascript&lt;/strong&gt; package.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Implementation&lt;/th&gt;
&lt;th&gt;Time (1000 iterations)&lt;/th&gt;
&lt;th&gt;Relative&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;react-native-ulid-jsi (JSI/C++)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.17ms&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~500x faster&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JavaScript (ulid package)&lt;/td&gt;
&lt;td&gt;83.62ms&lt;/td&gt;
&lt;td&gt;baseline&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Benchmark notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;device: &lt;strong&gt;iPhone 16 Pro&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;build: &lt;strong&gt;production&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;loop: 1000 ULID generations&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Why it’s fast
&lt;/h2&gt;

&lt;p&gt;The speed comes from several practical choices:&lt;/p&gt;
&lt;h3&gt;
  
  
  1) Zero bridge overhead
&lt;/h3&gt;

&lt;p&gt;JSI binding means the call is direct, not marshaled through the RN Bridge.&lt;/p&gt;
&lt;h3&gt;
  
  
  2) Native secure randomness
&lt;/h3&gt;

&lt;p&gt;The random portion uses platform-native secure RNG:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;iOS: &lt;code&gt;SecRandomCopyBytes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Android: &lt;code&gt;getrandom&lt;/code&gt; when available, otherwise &lt;code&gt;/dev/urandom&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;last resort: &lt;code&gt;std::random_device&lt;/code&gt; on other platforms&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3) Hand-optimized Base32 encoding
&lt;/h3&gt;

&lt;p&gt;ULID uses Crockford’s Base32 (excluding ambiguous chars like I, L, O, U).&lt;br&gt;&lt;br&gt;
The encoding is implemented in C++ with tight control over memory and branching.&lt;/p&gt;
&lt;h3&gt;
  
  
  4) Monotonic generation with thread-local state
&lt;/h3&gt;

&lt;p&gt;If you generate multiple ULIDs within the same millisecond, “pure random” ULIDs are not guaranteed to be sorted.&lt;/p&gt;

&lt;p&gt;This library ensures monotonic ordering by keeping per-thread state:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;same ms - increment randomness&lt;/li&gt;
&lt;li&gt;time changed - generate fresh random bytes&lt;/li&gt;
&lt;li&gt;overflow - regenerate safely&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  5) Minimal allocations
&lt;/h3&gt;

&lt;p&gt;Stack buffers. No heap churn. No dependency overhead.&lt;/p&gt;


&lt;h2&gt;
  
  
  Monotonic ULID: why it matters in real apps
&lt;/h2&gt;

&lt;p&gt;If you generate IDs quickly (chat typing, bulk inserts, offline queue replay), you want ordering to reflect creation order.&lt;/p&gt;

&lt;p&gt;Without monotonic behavior:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Pure random: not guaranteed to be &amp;gt; lexicographically&lt;/span&gt;
&lt;span class="nx"&gt;id1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="nx"&gt;HGW4Z6C8ABCDEFGHIJKLMNOP&lt;/span&gt;
&lt;span class="nx"&gt;id2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="nx"&gt;HGW4Z6C8ZYXWVUTSRQPONMLK&lt;/span&gt;  &lt;span class="c1"&gt;// could be "smaller" later&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With monotonic ULID (this library):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;id1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="nx"&gt;HGW4Z6C8ABCDEFGHIJKLMNOP&lt;/span&gt;
&lt;span class="nx"&gt;id2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="nx"&gt;HGW4Z6C8ABCDEFGHIJKLMNPQ&lt;/span&gt;  &lt;span class="c1"&gt;// guaranteed &amp;gt; id1&lt;/span&gt;
&lt;span class="nx"&gt;id3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="nx"&gt;HGW4Z6C8ABCDEFGHIJKLMNPR&lt;/span&gt;  &lt;span class="c1"&gt;// guaranteed &amp;gt; id2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why you care:&lt;br&gt;
    • smoother DB inserts and index locality&lt;br&gt;
    • stable ordering when timestamps match&lt;br&gt;
    • better behavior in event streams and sync logs&lt;/p&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;yarn&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;native&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;ulid&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;jsi&lt;/span&gt;
&lt;span class="nx"&gt;cd&lt;/span&gt; &lt;span class="nx"&gt;ios&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;pod&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ulid&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-native-ulid-jsi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ulid&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Technical details (for people who care)&lt;/strong&gt;&lt;br&gt;
    • C++ implementation + JSI bindings&lt;br&gt;
    • secure randomness with platform fallbacks&lt;br&gt;
    • Crockford’s Base32 encoding&lt;br&gt;
    • supports iOS 12+ and Android API 21+&lt;br&gt;
    • works on New + Old RN architecture&lt;br&gt;
    • zero JavaScript dependency footprint&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When you should use it&lt;/strong&gt;&lt;br&gt;
This library is especially useful when:&lt;br&gt;
    • you generate lots of IDs in a session&lt;br&gt;
    • you insert frequently into SQLite/Postgres indexes&lt;br&gt;
    • you want time-sortable IDs without storing separate timestamps&lt;br&gt;
    • you have offline-first queues / event logs&lt;br&gt;
    • you care about performance and battery&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links&lt;/strong&gt;&lt;br&gt;
    • GitHub: &lt;a href="https://github.com/pioner92/react-native-ulid-jsi" rel="noopener noreferrer"&gt;https://github.com/pioner92/react-native-ulid-jsi&lt;/a&gt;&lt;br&gt;
    • npm: &lt;a href="https://www.npmjs.com/package/react-native-ulid-jsi" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/react-native-ulid-jsi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>react</category>
      <category>jsi</category>
    </item>
    <item>
      <title>⚡️ Superfast, Cross-Platform String Hashing in React Native with react-native-xxhash</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Thu, 17 Apr 2025 12:15:09 +0000</pubDate>
      <link>https://forem.com/pioner92/superfast-cross-platform-string-hashing-in-react-native-with-react-native-xxhash-502f</link>
      <guid>https://forem.com/pioner92/superfast-cross-platform-string-hashing-in-react-native-with-react-native-xxhash-502f</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F735w00wcgd3sa2wujhoq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F735w00wcgd3sa2wujhoq.png" alt="Logo" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“How can I hash strings super fast, on both Android and iOS?”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you're building a React Native app and have ever asked this question, this post is for you.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧹 The Problem
&lt;/h3&gt;

&lt;p&gt;React Native has incredible potential for cross-platform development — but performance bottlenecks lurk beneath the surface, especially when dealing with string transformations or hashing large payloads.&lt;/p&gt;

&lt;p&gt;Need a fast, deterministic hash function to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create stable cache keys?&lt;/li&gt;
&lt;li&gt;Compare large strings quickly?&lt;/li&gt;
&lt;li&gt;Identify duplicates or generate lightweight identifiers?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;JavaScript isn't ideal here: hashing in JS can be slow, and worse, it runs on the main thread. That can seriously impact performance in complex apps.&lt;/p&gt;




&lt;h3&gt;
  
  
  🚀 Meet &lt;code&gt;react-native-xxhash&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/pioner92/react-native-xxhash" rel="noopener noreferrer"&gt;&lt;code&gt;react-native-xxhash&lt;/code&gt;&lt;/a&gt; is a lightweight JSI-based React Native library that uses &lt;a href="http://cyan4973.github.io/xxHash/" rel="noopener noreferrer"&gt;xxHash&lt;/a&gt;: a lightning-fast, non-cryptographic hashing algorithm written in C++.&lt;/p&gt;

&lt;p&gt;With zero bridge overhead and native execution, it delivers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔥 &lt;strong&gt;Blazing-fast hashing&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🔄 &lt;strong&gt;Deterministic output&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;📏 &lt;strong&gt;64-bit and 128-bit hash support&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;📱 &lt;strong&gt;iOS and Android compatibility&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;⚖️ &lt;strong&gt;JSI bindings for zero-copy, zero-bridge calls&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  📦 Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;react-native-xxhash
&lt;span class="c"&gt;# or&lt;/span&gt;
yarn add react-native-xxhash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install pods on iOS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;ios &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pod &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  ✨ Usage Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;hash64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;hash128&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-xxhash&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hashA&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;hash64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello world&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hashB&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;hash128&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello world&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;64-bit hash:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;hashA&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;128-bit hash:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;hashB&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  In a Component
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Text&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;hash64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;hash128&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-xxhash&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;64-bit:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;hash64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;128-bit:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;hash128&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;justifyContent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;center&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;alignItems&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;center&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Check your console for hash results!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  📚 API Reference
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;hash64(input: string): string&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Returns a 64-bit xxHash of the input string.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;hash128(input: string): string&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Returns a 128-bit xxHash of the input string.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🚀 Under the Hood
&lt;/h3&gt;

&lt;p&gt;This library:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses the official C++ implementation of xxHash&lt;/li&gt;
&lt;li&gt;Leverages JSI for direct bindings (no bridge involved)&lt;/li&gt;
&lt;li&gt;Runs entirely in native code&lt;/li&gt;
&lt;li&gt;Avoids serialization overhead&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  📂 Use Cases
&lt;/h3&gt;

&lt;p&gt;This library is ideal when you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deterministic keys for cache or storage&lt;/li&gt;
&lt;li&gt;Fast string comparisons&lt;/li&gt;
&lt;li&gt;Low-collision hash identifiers&lt;/li&gt;
&lt;li&gt;A non-cryptographic, high-speed hash&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🙌 Final Thoughts
&lt;/h3&gt;

&lt;p&gt;If you're building high-performance React Native apps and need lightweight hashing, &lt;code&gt;react-native-xxhash&lt;/code&gt; can be a perfect fit. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Check it out here: &lt;a href="https://github.com/pioner92/react-native-xxhash" rel="noopener noreferrer"&gt;https://github.com/pioner92/react-native-xxhash&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;PRs, feedback, and ideas are always welcome!&lt;/p&gt;




&lt;p&gt;Thanks for reading ✨&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>mobile</category>
      <category>ios</category>
      <category>android</category>
    </item>
    <item>
      <title>🚀 Access .env variables in React Native with native speed — Introducing react-native-config-jsi</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Tue, 15 Apr 2025 10:45:57 +0000</pubDate>
      <link>https://forem.com/pioner92/access-env-variables-in-react-native-with-native-speed-introducing-react-native-config-jsi-543h</link>
      <guid>https://forem.com/pioner92/access-env-variables-in-react-native-with-native-speed-introducing-react-native-config-jsi-543h</guid>
      <description>&lt;p&gt;Environment variables are a staple in every project. Whether it's your API key, app name, or feature flags — you've probably used &lt;code&gt;.env&lt;/code&gt; files with &lt;a href="https://github.com/luggit/react-native-config" rel="noopener noreferrer"&gt;&lt;code&gt;react-native-config&lt;/code&gt;&lt;/a&gt; or similar solutions.&lt;/p&gt;

&lt;p&gt;But here’s the catch: those tools are mostly &lt;strong&gt;bridge-based&lt;/strong&gt;, rely on runtime JSON, and aren’t exactly the fastest — especially for performance-sensitive apps.&lt;/p&gt;

&lt;p&gt;That’s why I built &lt;a href="https://github.com/pioner92/react-native-config-jsi" rel="noopener noreferrer"&gt;&lt;code&gt;react-native-config-jsi&lt;/code&gt;&lt;/a&gt; — a lightweight, ultra-fast &lt;strong&gt;JSI-based&lt;/strong&gt; library that lets you access &lt;code&gt;.env&lt;/code&gt; variables &lt;strong&gt;natively&lt;/strong&gt;, via C++.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡ Why this matters
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Synchronous access&lt;/strong&gt; to &lt;code&gt;.env&lt;/code&gt; variables at runtime (no async/Promise)&lt;/li&gt;
&lt;li&gt;⚙️ &lt;strong&gt;Backed by C++&lt;/strong&gt; and integrated via React Native JSI&lt;/li&gt;
&lt;li&gt;🧠 Minimal overhead — no bridges, no JSON, no wrappers&lt;/li&gt;
&lt;li&gt;🧩 Works like &lt;code&gt;react-native-config&lt;/code&gt; but faster and cleaner&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📦 Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;react-native-config-jsi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔧 Setup
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create your &lt;code&gt;.env&lt;/code&gt; file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;API_KEY=your_api_key
APP_NAME=MyAwesomeApp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;For iOS:&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;pod install&lt;/code&gt; inside the &lt;code&gt;ios/&lt;/code&gt; directory&lt;/li&gt;
&lt;li&gt;Add a &lt;strong&gt;Run Script Phase&lt;/strong&gt; in Xcode Build Phases:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;SRCROOT&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/../node_modules/react-native-config-jsi/src/scripts/generate.sh"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This step ensures that your &lt;code&gt;.env&lt;/code&gt; gets compiled into a native source file during build time.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;RNConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-native-config-jsi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;apiKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;RNConfig&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;API_KEY&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;API_KEY:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;⚠️ After changing &lt;code&gt;.env&lt;/code&gt;, make sure to rebuild or restart the app to apply changes.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧩 Behind the scenes
&lt;/h2&gt;

&lt;p&gt;This library uses a small C++ layer to parse the &lt;code&gt;.env&lt;/code&gt; file at build time and expose the key-value pairs via a JSI binding. That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No bridge involved&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No runtime parsing&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant reads&lt;/strong&gt; from C++ memory&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠 Use cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Reading API keys or environment-specific configs at startup&lt;/li&gt;
&lt;li&gt;Feature toggles via env vars&lt;/li&gt;
&lt;li&gt;Optimizing config reads in performance-sensitive screens&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔗 Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/pioner92/react-native-config-jsi" rel="noopener noreferrer"&gt;pioner92/react-native-config-jsi&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;NPM: &lt;a href="https://www.npmjs.com/package/react-native-config-jsi" rel="noopener noreferrer"&gt;react-native-config-jsi&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;This is especially useful for those who already use JSI-based tooling or want the cleanest possible access to &lt;code&gt;.env&lt;/code&gt; variables &lt;strong&gt;without touching the bridge&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Try it out and let me know what you think — happy to answer questions and improve it based on real-world feedback!&lt;/p&gt;

&lt;p&gt;🧠&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>mobile</category>
      <category>jsi</category>
      <category>ios</category>
    </item>
    <item>
      <title>🚀 Introducing react-native-sync-tasks: Native JSI-Powered HTTP Polling Off the JS Thread</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Mon, 14 Apr 2025 20:51:10 +0000</pubDate>
      <link>https://forem.com/pioner92/introducing-react-native-sync-tasks-native-jsi-powered-background-polling-for-react-native-30dd</link>
      <guid>https://forem.com/pioner92/introducing-react-native-sync-tasks-native-jsi-powered-background-polling-for-react-native-30dd</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe1pire86fdyf4zbisbde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe1pire86fdyf4zbisbde.png" alt="Demo" width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever needed to &lt;strong&gt;periodically fetch data&lt;/strong&gt; from a remote API in your React Native app? Maybe you're building a chat client that polls for new messages, or a dashboard that refreshes frequently with updated metrics?&lt;/p&gt;

&lt;p&gt;Most developers reach for this kind of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;interval&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://your-api.com/status&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="c1"&gt;// do something&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works... &lt;strong&gt;until it doesn’t&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple polling tasks run in parallel and get messy ☠️&lt;/li&gt;
&lt;li&gt;You start hitting performance issues and blocking the JS thread 🚨&lt;/li&gt;
&lt;li&gt;Managing lifecycles and cleanup becomes tedious 🧠&lt;/li&gt;
&lt;li&gt;You process &lt;strong&gt;the same data repeatedly&lt;/strong&gt;, wasting CPU cycles 📉&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s why I built &lt;a href="https://github.com/pioner92/react-native-sync-tasks" rel="noopener noreferrer"&gt;&lt;code&gt;react-native-sync-tasks&lt;/code&gt;&lt;/a&gt; — a blazing-fast, &lt;strong&gt;native JSI-based&lt;/strong&gt; polling library for React Native, written in C++ and Rust, with a clean and intuitive JS API. It runs &lt;strong&gt;outside of the JS thread&lt;/strong&gt;, leveraging native threads for maximum performance.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Why use SyncTasksManager?
&lt;/h2&gt;

&lt;p&gt;✅ Executes periodic polling in &lt;strong&gt;native threads&lt;/strong&gt;, not in JS timers&lt;br&gt;
✅ Callback only fires when the response &lt;strong&gt;has changed&lt;/strong&gt; (using response hash)&lt;br&gt;
✅ Centralized task management with start/stop control&lt;br&gt;
✅ Keeps your JS thread free and UI smooth&lt;br&gt;
✅ Zero runtime dependencies — fully native via JSI&lt;/p&gt;




&lt;h2&gt;
  
  
  ✨ Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🔁 Periodic HTTP polling with configurable interval&lt;/li&gt;
&lt;li&gt;📡 &lt;code&gt;onData&lt;/code&gt; callback when data is received (only if changed)&lt;/li&gt;
&lt;li&gt;❌ &lt;code&gt;onError&lt;/code&gt; callback for failed requests&lt;/li&gt;
&lt;li&gt;🧵 Native execution via C++/Rust threads (JSI)&lt;/li&gt;
&lt;li&gt;🧠 Smart deduplication (response body hash)&lt;/li&gt;
&lt;li&gt;✅ Centralized control over all polling tasks&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Quick Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createTask&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;SyncTasksManager&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-sync-tasks&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createTask&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://jsonplaceholder.typicode.com/posts/1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;onData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;DATA:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;onError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ERROR:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;SyncTasksManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addTask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;SyncTasksManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startAll&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📦 Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;react-native-sync-tasks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Don’t forget to run &lt;code&gt;pod install&lt;/code&gt; on iOS.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ⚙️ Under the Hood
&lt;/h2&gt;

&lt;p&gt;This library is built entirely with native performance in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🦀 Rust handles the HTTP logic and hashing&lt;/li&gt;
&lt;li&gt;⚙️ C++ bridges with JSI in React Native&lt;/li&gt;
&lt;li&gt;🚫 No timers or polling in JS — it’s all native&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ⚠️ Not a true background task
&lt;/h3&gt;

&lt;p&gt;This library &lt;strong&gt;does not continue polling when the app is in background or terminated&lt;/strong&gt;. It is meant for offloading polling work to native threads &lt;strong&gt;while the app is active&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 Use cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🔄 Real-time metrics dashboards&lt;/li&gt;
&lt;li&gt;💬 Chat apps polling for new messages&lt;/li&gt;
&lt;li&gt;📲 Device status updates&lt;/li&gt;
&lt;li&gt;🔔 Periodic checks to backend APIs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔗 Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/pioner92/react-native-sync-tasks" rel="noopener noreferrer"&gt;pioner92/react-native-sync-tasks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;NPM: &lt;a href="https://www.npmjs.com/package/react-native-sync-tasks" rel="noopener noreferrer"&gt;react-native-sync-tasks&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you’re building something that needs smooth, high-frequency API polling without hurting performance — give it a try!&lt;/p&gt;

&lt;p&gt;Feedback and contributions are welcome 🙌&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>jsi</category>
      <category>ios</category>
      <category>mobile</category>
    </item>
    <item>
      <title>🚀 Save Any React Native View to Gallery Using RN Skia + JSI (react-native-img-buffer-save)</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Thu, 10 Apr 2025 14:30:13 +0000</pubDate>
      <link>https://forem.com/pioner92/save-any-react-native-view-to-gallery-using-skia-jsi-react-native-img-buffer-save-2p27</link>
      <guid>https://forem.com/pioner92/save-any-react-native-view-to-gallery-using-skia-jsi-react-native-img-buffer-save-2p27</guid>
      <description>&lt;h2&gt;
  
  
  Capture any React Native view using react-native-skia, convert it into an image, and save it directly to the device's gallery using a high-performance JSI-native library.
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Saving images directly from rendered views into the device's gallery used to require multiple bridges, performance compromises, or complex native code. Not anymore.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article, we’ll show you how to capture &lt;strong&gt;any view content in React Native&lt;/strong&gt;, convert it to an image using &lt;strong&gt;react-native-skia&lt;/strong&gt;, and save it &lt;strong&gt;directly to the device's gallery&lt;/strong&gt; using a blazing-fast &lt;strong&gt;native JSI module&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Introducing: &lt;a href="https://github.com/pioner92/react-native-img-buffer-save" rel="noopener noreferrer"&gt;&lt;code&gt;react-native-img-buffer-save&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 The Problem
&lt;/h2&gt;

&lt;p&gt;You're building a feature where the user sees a &lt;strong&gt;custom visual element&lt;/strong&gt; — maybe a QR code, a certificate, a card, a chart — and you want them to be able to &lt;strong&gt;save it as an image&lt;/strong&gt; into their gallery.&lt;/p&gt;

&lt;p&gt;In a typical React Native setup, this means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Capturing a view visually.&lt;/li&gt;
&lt;li&gt;Converting it to image bytes.&lt;/li&gt;
&lt;li&gt;Passing it through the JS bridge to native code to save it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This process is often clunky, slow, and complex.&lt;/p&gt;

&lt;p&gt;What if you could do it all — &lt;strong&gt;capture any React Native View and save it instantly to the gallery&lt;/strong&gt; — in just a few lines of code?&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡ The Solution: &lt;code&gt;react-native-img-buffer-save&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This library, built using &lt;strong&gt;JSI (JavaScript Interface)&lt;/strong&gt;, allows you to save raw image buffers (like &lt;code&gt;Uint8Array&lt;/code&gt; or &lt;code&gt;ArrayBuffer&lt;/code&gt;) directly to the device's gallery — with zero bridge overhead.&lt;/p&gt;

&lt;p&gt;Paired with &lt;strong&gt;React Native Skia&lt;/strong&gt;, you can snapshot any view or canvas, encode it as a PNG or JPEG, and push it straight to the gallery. Fast and native.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 Installation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Yarn
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn add react-native-img-buffer-save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  NPM
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;react-native-img-buffer-save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  iOS Only
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;ios &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pod &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  👨‍💻 Example: Capture Any View and Save It
&lt;/h2&gt;

&lt;p&gt;Let’s say you have any visual content in a view that you want to turn into an image and save:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt; &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;refView&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* Your custom QR code, styled view, or anything else */&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using react-native-skia, you can render the view and extract its image bytes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;snapshot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;makeImageFromView&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;refView&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;snapshot&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;encodeToBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ImageFormat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PNG&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;saveImageToGallery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Failed to save image:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ This works for any rendered content — QR codes, charts, posters, styled UI blocks — as long as you can capture it with react-native-skia.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Under the Hood
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Written in C++ with JSI for &lt;strong&gt;maximum performance&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;No JS bridge overhead.&lt;/li&gt;
&lt;li&gt;Accepts both &lt;code&gt;Uint8Array&lt;/code&gt; and &lt;code&gt;ArrayBuffer&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Works on both Android and iOS.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧪 Full Usage Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TouchableOpacity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;StyleSheet&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;saveImageToGallery&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-img-buffer-save&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;saveImg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;imageBytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;// Replace with real image&lt;/span&gt;
    &lt;span class="nf"&gt;saveImageToGallery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imageBytes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TouchableOpacity&lt;/span&gt; &lt;span class="na"&gt;onPress&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;saveImg&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Save IMG to gallery&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;TouchableOpacity&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;View&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;styles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;StyleSheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;justifyContent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;center&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;alignItems&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;center&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🛠️ Contribute or Report Issues
&lt;/h2&gt;

&lt;p&gt;The library is open-source. Star it ⭐, use it, and feel free to contribute!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/pioner92/react-native-img-buffer-save" rel="noopener noreferrer"&gt;https://github.com/pioner92/react-native-img-buffer-save&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Made with ❤️ and &lt;a href="https://github.com/callstack/react-native-builder-bob" rel="noopener noreferrer"&gt;&lt;code&gt;create-react-native-library&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>mobile</category>
      <category>imageprocessing</category>
      <category>react</category>
    </item>
    <item>
      <title>🧵 Improve UX in React Native with Native Fade Gradients</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Thu, 10 Apr 2025 10:58:23 +0000</pubDate>
      <link>https://forem.com/pioner92/improve-ux-in-react-native-with-native-fade-gradients-f2f</link>
      <guid>https://forem.com/pioner92/improve-ux-in-react-native-with-native-fade-gradients-f2f</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftz8wyq28mkk101smi9pn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftz8wyq28mkk101smi9pn.png" alt="Demo" width="800" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Smooth fade gradients at the edges of your content can make a huge difference in how users perceive scrolling interfaces. They hint at overflow, suggest direction, and provide a more polished look. But implementing them natively in React Native can be tricky...&lt;/p&gt;

&lt;p&gt;That’s why I built &lt;a href="https://www.npmjs.com/package/rn-fade-wrapper" rel="noopener noreferrer"&gt;&lt;code&gt;rn-fade-wrapper&lt;/code&gt;&lt;/a&gt;—a lightweight, high-performance library for adding native gradient fades to any scrollable or overflowing content. It works with both old and new architectures (Fabric), and supports iOS, Android, and Expo out of the box.&lt;/p&gt;




&lt;h3&gt;
  
  
  ✨ Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Native rendering via &lt;code&gt;CAGradientLayer&lt;/code&gt; (iOS) and Canvas (Android)&lt;/li&gt;
&lt;li&gt;↕ Supports vertical and horizontal fades&lt;/li&gt;
&lt;li&gt;🌟 Fully customizable: color, size, per-edge control&lt;/li&gt;
&lt;li&gt;↔ Inward fading option (towards content)&lt;/li&gt;
&lt;li&gt;⚖ Drop-in wrapper component with simple API&lt;/li&gt;
&lt;li&gt;🚀 Fabric-ready with TypeScript types&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ⚡ Quick Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;FadeWrapper&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rn-fade-wrapper&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;FadeWrapper&lt;/span&gt;
  &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#000"&lt;/span&gt;
  &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;orientation&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"vertical"&lt;/span&gt;
&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ScrollView&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Some long content...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;ScrollView&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;FadeWrapper&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  📦 Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn add rn-fade-wrapper
&lt;span class="c"&gt;# or&lt;/span&gt;
npm &lt;span class="nb"&gt;install &lt;/span&gt;rn-fade-wrapper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Works with Expo too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx expo &lt;span class="nb"&gt;install &lt;/span&gt;rn-fade-wrapper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🔧 Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;ScrollViews, FlatLists, and SectionLists&lt;/li&gt;
&lt;li&gt;Carousels or horizontal sliders&lt;/li&gt;
&lt;li&gt;Modals with long content&lt;/li&gt;
&lt;li&gt;Any container with potential overflow&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🌐 Under the Hood
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;iOS&lt;/strong&gt;: uses &lt;code&gt;CAGradientLayer&lt;/code&gt; inside a custom &lt;code&gt;UIView&lt;/code&gt;, overlaid on the target content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android&lt;/strong&gt;: draws a &lt;code&gt;LinearGradient&lt;/code&gt; via &lt;code&gt;Canvas&lt;/code&gt; on a custom &lt;code&gt;ViewGroup&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Efficient &lt;code&gt;onLayout&lt;/code&gt; and re-render management to minimize overhead.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🎉 Bonus: Customization Power
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;FadeWrapper&lt;/span&gt;
  &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"rgba(0,0,0,0.5)"&lt;/span&gt;
  &lt;span class="na"&gt;sizes&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;inward&lt;/span&gt;
&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;FlatList&lt;/span&gt; &lt;span class="err"&gt;...&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;FadeWrapper&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Want horizontal fading? Just set &lt;code&gt;orientation="horizontal"&lt;/code&gt; or define &lt;code&gt;left&lt;/code&gt; / &lt;code&gt;right&lt;/code&gt; in &lt;code&gt;sizes&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  📅 Why It Matters
&lt;/h3&gt;

&lt;p&gt;Polished visual feedback can increase perceived performance and user satisfaction. Native gradients feel smooth and fluid, especially in content-heavy UIs. &lt;code&gt;rn-fade-wrapper&lt;/code&gt; helps you build delightful UI with minimal effort.&lt;/p&gt;




&lt;h3&gt;
  
  
  📚 Learn More
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/pioner92/react-native-auto-skeleton" rel="noopener noreferrer"&gt;pioner92/react-native-auto-skeleton&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;NPM: &lt;a href="https://www.npmjs.com/package/rn-fade-wrapper" rel="noopener noreferrer"&gt;rn-fade-wrapper&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Expo support&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you like this, give it a ⭐ on GitHub or try it out in your next UI!&lt;/p&gt;




&lt;p&gt;Happy fading ✨&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>react</category>
      <category>ios</category>
      <category>android</category>
    </item>
    <item>
      <title>🔥 React Native Auto Skeleton – Lightweight Skeleton Loader for React Native</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Thu, 10 Apr 2025 09:23:07 +0000</pubDate>
      <link>https://forem.com/pioner92/-react-native-auto-skeleton-lightweight-skeleton-loader-for-react-native-41k1</link>
      <guid>https://forem.com/pioner92/-react-native-auto-skeleton-lightweight-skeleton-loader-for-react-native-41k1</guid>
      <description>&lt;h2&gt;
  
  
  Effortless Skeleton Loading in React Native: Introducing react-native-auto-skeleton
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzj8x0x1xic5n9gplh4z1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzj8x0x1xic5n9gplh4z1.png" alt="Demo" width="800" height="687"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Skeleton loaders are essential for improving perceived performance and user experience, especially in mobile apps where data fetching can take time. But let’s face it — configuring them manually in React Native is tedious. Defining skeleton views for every block, ensuring consistent styles, adding shimmer... it all takes time.&lt;/p&gt;

&lt;p&gt;What if your UI could generate its own skeletons automatically?&lt;/p&gt;

&lt;p&gt;That’s exactly what &lt;a href="https://github.com/pioner92/react-native-auto-skeleton" rel="noopener noreferrer"&gt;&lt;code&gt;react-native-auto-skeleton&lt;/code&gt;&lt;/a&gt; does — &lt;strong&gt;automatically builds skeleton placeholders&lt;/strong&gt; based on your existing layout, with zero configuration, full Fabric support, and clean animation out of the box.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Why This Library Stands Out
&lt;/h2&gt;

&lt;p&gt;Here’s what makes &lt;code&gt;react-native-auto-skeleton&lt;/code&gt; unique:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No boilerplate setup&lt;/strong&gt; — wrap your UI with &lt;code&gt;AutoSkeletonView&lt;/code&gt; and you're done.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supports both old and new architectures&lt;/strong&gt; (Fabric-ready).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expo-compatible&lt;/strong&gt; — works with &lt;code&gt;expo prebuild&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three animation modes&lt;/strong&gt;: gradient shimmer, pulse, or no animation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smart defaults&lt;/strong&gt; for radius, layout, and background.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unlike other libraries that require verbose configurations for each skeleton block, this one reads your view structure and applies skeletons intelligently.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠 How to Use
&lt;/h2&gt;

&lt;p&gt;Installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn add react-native-auto-skeleton
&lt;span class="c"&gt;# or&lt;/span&gt;
npm &lt;span class="nb"&gt;install &lt;/span&gt;react-native-auto-skeleton
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basic usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AutoSkeletonView&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;AutoSkeletonIgnoreView&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-auto-skeleton&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AutoSkeletonView&lt;/span&gt; &lt;span class="na"&gt;isLoading&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isLoading&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Loading user profile...&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AutoSkeletonIgnoreView&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;This section won’t get a skeleton&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;AutoSkeletonIgnoreView&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;AutoSkeletonView&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can customize:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shimmer speed&lt;/li&gt;
&lt;li&gt;Gradient colors&lt;/li&gt;
&lt;li&gt;Default border radius&lt;/li&gt;
&lt;li&gt;Animation type (&lt;code&gt;pulse&lt;/code&gt;, &lt;code&gt;gradient&lt;/code&gt;, or &lt;code&gt;none&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📱 Fabric-Ready and Future-Proof
&lt;/h2&gt;

&lt;p&gt;The library is written with the new architecture in mind. Whether you’re migrating to Fabric or building greenfield, it fits right in. It also supports old architecture, so you can adopt it incrementally.&lt;/p&gt;




&lt;h2&gt;
  
  
  🆚 How It Compares
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;react-native-auto-skeleton&lt;/th&gt;
&lt;th&gt;react-native-skeleton-placeholder&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Auto layout parsing&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fabric support&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works with Expo&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;⚠️ Partial&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Manual block setup required&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Built-in shimmer and pulse animation&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  📦 Explore More
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📦 &lt;a href="https://www.npmjs.com/package/react-native-auto-skeleton" rel="noopener noreferrer"&gt;NPM package&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💻 &lt;a href="https://github.com/pioner92/react-native-auto-skeleton" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📱 Expo support &lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you're building React Native apps in 2024, it’s time to stop writing skeletons manually. Try &lt;code&gt;react-native-auto-skeleton&lt;/code&gt;, and enjoy fast, beautiful, and automatic loading states.&lt;/p&gt;

&lt;p&gt;✨ Star the project on GitHub if it helps you — it means a lot!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Created and maintained by &lt;a href="https://github.com/pioner92" rel="noopener noreferrer"&gt;@pioner92&lt;/a&gt; — feel free to contribute or ask questions!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>react</category>
      <category>ios</category>
      <category>android</category>
    </item>
  </channel>
</rss>
