UNPKG

@ea-lab/reactive-json

Version:

A REACT-based lib that transforms JSON (or YAML) into interactive HTML markup.

12 lines (11 loc) 497 B
import { useContext as o } from "react"; import { GlobalDataContext as n } from "../../engine/GlobalDataContext.js"; import { TemplateContext as l } from "../../engine/TemplateContext.js"; import { evaluateTemplateValue as m } from "../../engine/TemplateSystem.js"; const s = (e) => { const a = o(n), r = o(l), { to: t } = e.actionProps; !t || typeof t != "string" || (window.location.href = m({ valueToEvaluate: t, globalDataContext: a, templateContext: r })); }; export { s as Redirect };