JSFiddle - React, Tailwind, and code Playground

JavaScript

object = {"nature":{
        "type": "select",
        "dataSource": "function(e) {alert('ok')}"
    	}
    }
    
    var x = eval("("+object.nature.dataSource+")");
    x()