@metamask/snaps-sdk
Version:
A library containing the core functionality for building MetaMask Snaps
27 lines • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsxDEV = void 0;
const jsx_runtime_1 = require("./jsx-runtime.cjs");
const validation_1 = require("./validation.cjs");
/**
* The JSX runtime for Snaps SDK components. This function is used to render
* Snap components into a format that can be used by the Snaps.
*
* This is the "development" version of the runtime, which includes additional
* validation, which is otherwise handled by MetaMask. To use this runtime,
* specify `@metamask/snaps-sdk` as import source for JSX, and use
* `react-jsxdev` as the pragma.
*
* @param component - The component to render.
* @param props - The props to pass to the component.
* @param key - The key of the component.
* @returns The rendered component.
* @see https://www.typescriptlang.org/tsconfig/#jsx
*/
function jsxDEV(component, props, key) {
const element = (0, jsx_runtime_1.jsx)(component, props, key);
(0, validation_1.assertJSXElement)(element);
return element;
}
exports.jsxDEV = jsxDEV;
//# sourceMappingURL=jsx-dev-runtime.cjs.map