From 7deae9c9f61dca9a6d3c69567ed7aac0923db6d1 Mon Sep 17 00:00:00 2001 From: centauri <83140718+centau@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:46:13 +0000 Subject: [PATCH] Allow `vide.branch` to be used in a reactive scope --- CHANGELOG.md | 8 ++++++++ src/branch.luau | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bd1bdd..6200484 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -------------------------------------------------------------------------------- +## Unreleased + +### Changed + +- `branch()` is now allowed to be used within a reactive scope. + +-------------------------------------------------------------------------------- + ## [0.4.0] - 2026-01-17 ### Added diff --git a/src/branch.luau b/src/branch.luau index a35c1b0..2138d06 100644 --- a/src/branch.luau +++ b/src/branch.luau @@ -13,8 +13,8 @@ local function branch(fn: () -> T): (() -> (), T) end local parent = current.owner - if not parent or parent.effect then - error(`current scope is not owned by a stable scope`, 0) + if not parent then + error(`current scope is not owned by a scope`, 0) end local node = create_node(parent, false, false)