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.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
/* Copyright 2026 Marimo. All rights reserved. */
// Dereferences a ref that should not be null; throws if the value is null
export function derefNotNull<T>(ref: React.RefObject<T | null>): T {
const value = ref.current;
if (value === null) {
throw new ReferenceError("Attempting to dereference null object.");
}
return value;
}