JSFiddle - React, Tailwind, and code Playground

by danShumway

JavaScript

//Use a factory pattern to generate code in the right scope.
//We generate this once, rather than regenerate it every time we call the annonymous function
function handleScope(callback, i) {
    return funcetion(e) {
       callback(e, i);  
    };
}