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

Function pushStartInstance

packages/react-markup/src/ReactFizzConfigMarkup.js:105–146  ·  view source on GitHub ↗
(
  target: Array<Chunk | PrecomputedChunk>,
  type: string,
  props: Object,
  resumableState: ResumableState,
  renderState: RenderState,
  preambleState: null | PreambleState,
  hoistableState: null | HoistableState,
  formatContext: FormatContext,
  textEmbedded: boolean,
)

Source from the content-addressed store, hash-verified

103}
104
105export function pushStartInstance(
106 target: Array<Chunk | PrecomputedChunk>,
107 type: string,
108 props: Object,
109 resumableState: ResumableState,
110 renderState: RenderState,
111 preambleState: null | PreambleState,
112 hoistableState: null | HoistableState,
113 formatContext: FormatContext,
114 textEmbedded: boolean,
115): ReactNodeList {
116 for (const propKey in props) {
117 if (hasOwnProperty.call(props, propKey)) {
118 const propValue = props[propKey];
119 if (propKey === 'ref' && propValue != null) {
120 throw new Error(
121 'Cannot pass ref in renderToHTML because they will never be hydrated.',
122 );
123 }
124 if (typeof propValue === 'function') {
125 throw new Error(
126 'Cannot pass event handlers (' +
127 propKey +
128 ') in renderToHTML because ' +
129 'the HTML will never be hydrated so they can never get called.',
130 );
131 }
132 }
133 }
134
135 return pushStartInstanceImpl(
136 target,
137 type,
138 props,
139 resumableState,
140 renderState,
141 preambleState,
142 hoistableState,
143 formatContext,
144 textEmbedded,
145 );
146}
147
148export function pushTextInstance(
149 target: Array<Chunk | PrecomputedChunk>,

Callers 1

renderHostElementFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected