Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

330 B
Raw Blame
/* Copyright 2026 Marimo. All rights reserved. */
export function mergeRefs<T>(
  ...refs: React.Ref<T>[]
): (value: T | null) => void {
  return (value) => {
    refs.forEach((ref) => {
      if (typeof ref === "function") {
        ref(value);
      } else if (ref != null) {
        ref.current = value;
      }
    });
  };
}