Skip to content

Instantly share code, notes, and snippets.

@Michael-Fares
Michael-Fares / Score.tsx
Last active April 7, 2026 13:30
Vexflow React Typescript Component
import { useEffect, useRef } from "react";
import VexFlow from "vexflow";
function Score({ scale }: { scale: Array<string> }) {
let rendered = false; // set a flag to prevent re-rendering if aleady rendered
/**
*
* @param notes array of notes to be renered to the score, e.g ["C", "D", "Eb", "F", "G", "G#" ...]