JSTQL-JS-Transform/output_testing/1088createElement-freeze.js

17 lines
452 B
JavaScript
Raw Normal View History

import React from "react";
import { shallowCopy } from "shared-runtime";
function Component(props) {
const childProps = {
style: {
width: props.width
}
};
const element = React.createElement("div", childProps, ["hello world"]);
// function that in theory could mutate, we assume not bc createElement freezes
childProps |> shallowCopy(%);
return element;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{}]
};