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

Function shouldSetTextContent

packages/react-noop-renderer/src/createReactNoop.js:291–300  ·  view source on GitHub ↗
(type: string, props: Props)

Source from the content-addressed store, hash-verified

289 }
290
291 function shouldSetTextContent(type: string, props: Props): boolean {
292 if (type === 'errorInBeginPhase') {
293 throw new Error('Error in host config.');
294 }
295 return (
296 typeof props.children === 'string' ||
297 typeof props.children === 'number' ||
298 typeof props.children === 'bigint'
299 );
300 }
301
302 function computeText(rawText, hostContext) {
303 return hostContext === UPPERCASE_CONTEXT ? rawText.toUpperCase() : rawText;

Callers 3

cloneInstanceFunction · 0.70
createInstanceFunction · 0.70
commitUpdateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected