Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building Instagram Reels-style video feeds in React Native with reels-kit

An open-source React Native toolkit for vertical video feeds: snap paging, bounded video players, tap and scrub gestures, and pluggable video adapters. A vertical video feed looks simple: full-screen videos, swipe up for the next one. Then you build it, and the details pile up. Every cell wants a native video player, so scrolling through twenty videos can mean twenty decoders. Videos keep playing…

Reels-kit is an open-source React Native toolkit designed for creating vertical video feeds with features like snap paging, bounded video players, tap and scrub gestures, and pluggable video adapters. The toolkit aims to simplify the implementation of a vertical video feed, which can quickly become complex due to the need for native video players for each cell.

As users scroll through multiple videos, each video may require its own decoder, leading to performance issues. Additionally, videos continue playing when the user navigates to another screen or sends the app to the background. Rapid swiping can cause the progress bar to jump instead of moving smoothly. The toolkit provides solutions to these issues by offering a headless building block around a FlashList-based feed, allowing developers to focus on the layout while handling the difficult parts.

Reels-kit consists of small, reusable components that work together to create a functional video feed. It measures the page height from the container instead of the window, enabling snap paging where one swipe moves one reel. Bounded players ensure that only the active reel and its neighboring reels mount a native player, improving performance by limiting the number of decoders in use.

Playback is paused when the reel is not active, the screen is unfocused, or the app is in the background. The toolkit supports tap to mute, optional double tap to like, and a drag-to-seek progress bar. It also handles failed loads by displaying a thumbnail until the video is ready, a buffering slot, and a retry option that remounts the player.

Users can bring their own video engine, as reels-kit does not include a default video library. The toolkit is built on FlashList 2, Reanimated 4, and Gesture Handler 3, making it compatible with React Native 0.82 or newer with the New Architecture. To use reels-kit, developers need to install several dependencies, including reels-kit, @shopify/flash-list, react-native-reanimated, react-native-worklets, and react-native-gesture-handler.

After installation, three setup steps are required: adding the worklets plugin to babel.config.js, wrapping the app in GestureHandlerRootView, and running pod install in the ios/ directory. A compatibility note is that Reanimated must match the React Native version, as different versions have different requirements.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Your first hackathon: prepare well and get your project to a working demo

Go into your first hackathon with a task you can finish and explain. For a beginner, a good result is concrete: your team builds a working user flow, submits the required materials on time and…

  • Approach first hackathon with clear goal of functional project
  • Ensure project completion, timely submission, and effective demonstration
  • Read participation rules, understand requirements, and communicate skills

Yogi Buddy: Yoga with me

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend What I Built Yogi Buddy: Yoga with Me is a friendly yoga companion that anyone can open and use straight away.

  • Yogi Buddy is a free, no-login yoga companion app.
  • App suggests personalized routines based on user input.
  • Open-source model swapping allows app flexibility.

Cudy TR1200 İncelemesi: Uygun Fiyata OpenWrt ve VPN Desteği

Genel Bakış Dışarıda çalışırken iş ağına güvenli şekilde bağlanabileceğim, telefon ve bilgisayar gibi cihazlarımı güvenli bir ağ tüneli üzerinden internete çıkarabileceğim, yerel ağdaki ayak izimi…

  • Cudy TR1200 offers OpenWrt and VPN support at affordable price
  • Features include Router/AP, WISP/Extender, multi-device compatibility
  • Hardware specs: 580 MHz CPU, 16 MB NOR flash, 128 MB DDR3 RAM

5 Signs You Need a Co-Development Partner

Nobody starts a game studio planning to ask for help. You build your team, define your vision, and set out to deliver something great. But game development is unpredictable. Scope creeps.

More from Monday 5 October →