main
js 13 lines 432 Bytes
Raw
1 function Component(props) {
2 const x = makeOptionalFunction(props);
3 // for a regular call, the JSX element could be independently memoized
4 // since it is an immutable value. however, because the call is optional,
5 // we can't extract out independent memoization for the element w/o
6 // forcing that argument to evaluate unconditionally
7 const y = x?.(
8 <div>
9 <span>{props.text}</span>
10 </div>
11 );
12 return y;
13 }