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

Function pushLinkImpl

packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js:3026–3056  ·  view source on GitHub ↗
(
  target: Array<Chunk | PrecomputedChunk>,
  props: Object,
)

Source from the content-addressed store, hash-verified

3024}
3025
3026function pushLinkImpl(
3027 target: Array<Chunk | PrecomputedChunk>,
3028 props: Object,
3029): null {
3030 target.push(startChunkForTag('link'));
3031
3032 for (const propKey in props) {
3033 if (hasOwnProperty.call(props, propKey)) {
3034 const propValue = props[propKey];
3035 if (propValue == null) {
3036 continue;
3037 }
3038 switch (propKey) {
3039 case 'children':
3040 case 'dangerouslySetInnerHTML':
3041 throw new Error(
3042 `${'link'} is a self-closing tag and must neither have \`children\` nor ` +
3043 'use `dangerouslySetInnerHTML`.',
3044 );
3045 default:
3046 pushAttribute(target, propKey, propValue);
3047 break;
3048 }
3049 }
3050 }
3051
3052 // Link never participate as a ViewTransition
3053
3054 target.push(endOfStartTagSelfClosing);
3055 return null;
3056}
3057
3058function pushStyle(
3059 target: Array<Chunk | PrecomputedChunk>,

Callers 9

pushLinkFunction · 0.85
pushImgFunction · 0.85
flushStyleInPreambleFunction · 0.85
preloadLateStyleFunction · 0.85
prefetchDNSFunction · 0.85
preconnectFunction · 0.85
preloadFunction · 0.85
preloadModuleFunction · 0.85

Calls 3

startChunkForTagFunction · 0.85
pushAttributeFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected