MCPcopy
hub / github.com/nfl/react-helmet / mapNestedChildrenToProps

Method mapNestedChildrenToProps

src/Helmet.js:96–119  ·  view source on GitHub ↗
(child, nestedChildren)

Source from the content-addressed store, hash-verified

94 }
95
96 mapNestedChildrenToProps(child, nestedChildren) {
97 if (!nestedChildren) {
98 return null;
99 }
100
101 switch (child.type) {
102 case TAG_NAMES.SCRIPT:
103 case TAG_NAMES.NOSCRIPT:
104 return {
105 innerHTML: nestedChildren
106 };
107
108 case TAG_NAMES.STYLE:
109 return {
110 cssText: nestedChildren
111 };
112 }
113
114 throw new Error(
115 `<${
116 child.type
117 } /> elements are self-closing and can not contain children. Refer to our API for more information.`
118 );
119 }
120
121 flattenArrayTypeChildren({
122 child,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected