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

Function pushStartObject

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

Source from the content-addressed store, hash-verified

1968}
1969
1970function pushStartObject(
1971 target: Array<Chunk | PrecomputedChunk>,
1972 props: Object,
1973 formatContext: FormatContext,
1974): ReactNodeList {
1975 target.push(startChunkForTag('object'));
1976
1977 let children = null;
1978 let innerHTML = null;
1979 for (const propKey in props) {
1980 if (hasOwnProperty.call(props, propKey)) {
1981 const propValue = props[propKey];
1982 if (propValue == null) {
1983 continue;
1984 }
1985 switch (propKey) {
1986 case 'children':
1987 children = propValue;
1988 break;
1989 case 'dangerouslySetInnerHTML':
1990 innerHTML = propValue;
1991 break;
1992 case 'data': {
1993 if (__DEV__) {
1994 checkAttributeStringCoercion(propValue, 'data');
1995 }
1996 const sanitizedValue = sanitizeURL('' + propValue);
1997 if (sanitizedValue === '') {
1998 if (__DEV__) {
1999 console.error(
2000 'An empty string ("") was passed to the %s attribute. ' +
2001 'To fix this, either do not render the element at all ' +
2002 'or pass null to %s instead of an empty string.',
2003 propKey,
2004 propKey,
2005 );
2006 }
2007 break;
2008 }
2009 target.push(
2010 attributeSeparator,
2011 stringToChunk('data'),
2012 attributeAssign,
2013 stringToChunk(escapeTextForBrowser(sanitizedValue)),
2014 attributeEnd,
2015 );
2016 break;
2017 }
2018 default:
2019 pushAttribute(target, propKey, propValue);
2020 break;
2021 }
2022 }
2023 }
2024
2025 pushViewTransitionAttributes(target, formatContext);
2026
2027 target.push(endOfStartTag);

Callers 1

pushStartInstanceFunction · 0.85

Calls 11

stringToChunkFunction · 0.90
startChunkForTagFunction · 0.85
sanitizeURLFunction · 0.85
escapeTextForBrowserFunction · 0.85
pushAttributeFunction · 0.85
pushInnerHTMLFunction · 0.85
encodeHTMLTextNodeFunction · 0.85
pushMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected