MCPcopy Index your code
hub / github.com/react/react / pushStyleImpl

Function pushStyleImpl

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

Source from the content-addressed store, hash-verified

3209) => `${prefix}${s === 's' ? '\\73 ' : '\\53 '}${suffix}`;
3210
3211function pushStyleImpl(
3212 target: Array<Chunk | PrecomputedChunk>,
3213 props: Object,
3214): ReactNodeList {
3215 target.push(startChunkForTag('style'));
3216
3217 let children = null;
3218 let innerHTML = null;
3219 for (const propKey in props) {
3220 if (hasOwnProperty.call(props, propKey)) {
3221 const propValue = props[propKey];
3222 if (propValue == null) {
3223 continue;
3224 }
3225 switch (propKey) {
3226 case 'children':
3227 children = propValue;
3228 break;
3229 case 'dangerouslySetInnerHTML':
3230 innerHTML = propValue;
3231 break;
3232 default:
3233 pushAttribute(target, propKey, propValue);
3234 break;
3235 }
3236 }
3237 }
3238
3239 // Style never participate as a ViewTransition.
3240 target.push(endOfStartTag);
3241
3242 const child = Array.isArray(children)
3243 ? children.length < 2
3244 ? children[0]
3245 : null
3246 : children;
3247 if (
3248 typeof child !== 'function' &&
3249 typeof child !== 'symbol' &&
3250 child !== null &&
3251 child !== undefined
3252 ) {
3253 target.push(stringToChunk(escapeStyleTextContent(child)));
3254 }
3255 pushInnerHTML(target, innerHTML, children);
3256 target.push(endChunkForTag('style'));
3257 return null;
3258}
3259
3260function pushStyleContents(
3261 target: Array<Chunk | PrecomputedChunk>,

Callers 1

pushStyleFunction · 0.85

Calls 7

stringToChunkFunction · 0.90
startChunkForTagFunction · 0.85
pushAttributeFunction · 0.85
escapeStyleTextContentFunction · 0.85
pushInnerHTMLFunction · 0.85
endChunkForTagFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected