MCPcopy
hub / github.com/facebook/react / createJSXElementForTestComparison

Function createJSXElementForTestComparison

packages/jest-react/src/JestReact.js:43–67  ·  view source on GitHub ↗
(type, props)

Source from the content-addressed store, hash-verified

41}
42
43function createJSXElementForTestComparison(type, props) {
44 if (__DEV__) {
45 const element = {
46 $$typeof: REACT_ELEMENT_TYPE,
47 type: type,
48 key: null,
49 props: props,
50 _owner: null,
51 _store: __DEV__ ? {} : undefined,
52 };
53 Object.defineProperty(element, 'ref', {
54 enumerable: false,
55 value: null,
56 });
57 return element;
58 } else {
59 return {
60 $$typeof: REACT_ELEMENT_TYPE,
61 type: type,
62 key: null,
63 ref: null,
64 props: props,
65 };
66 }
67}
68
69export function unstable_toMatchRenderedOutput(root, expectedJSX) {
70 assertYieldsWereCleared(root);

Callers 2

jsonChildToJSXChildFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected